riaservices

[Silverlight] WCF RIA Services Issue With Updating

I am running into an issue with refreshing data on a page after doing an update through WCF RIA Services. I have a ComboBox and a Button on a page. The user chooses an item from the ComboBox, and then clicks the Button. This does a soft delete of the item in the database(setting "Active" = false). However, I would like for it to be remo...

How to prevent Silverlight RIA Entity getting attached to datacontext before i'm ready

I have a Silverlight 4 application for a simple 'TODO' list. The problem I'm having is that databinding is hooking up relationships on my TODO object, which causes the RIA data context to add it to the DataContext.TODOs list before I want it there. I want to treat the object as new and detached until I'm explicitly ready to add it to th...

Mixing RIA services and standard WCF services

Is it possible to have a mix of RIA WCF services and custom WCF services hosted in the same project? At the moment I have a server project hosting 2 RIA service classes, both of which work fine, and 1 WCF svc file, which loads up fine in the browser (e.g. http://localhost/services/service.svc) but when I access it through code in the Si...

Using Silverlight RIA Services DomainDataSource to query by user

So I am using the SL4 Business Template and the SQL Membership API. I created a user and I created a custom table that ties to that user. So I want to have a datagrid that show the item for the CURRENT (WebContext.Current.User) user. Why is the GUID for the user in WebContext.Current.User??? I need that to join to the 'Items' table. H...

Is it possible to change how DomainContexts are generated by Silverlight RiaServices?

Hi guys, Is it possible to change (maybe there is a T4 hidden somewhere...) the way Silverlight Ria Services generates the Domain Contexts classes? I would like to add an interface to them so my ViewModels can use the interface instead of the class making them more unit testable. Tks, André Carlucci ...

Trouble validating data in Silverlight 4 RIA services

Hello, I have a Silverlight 4 RIA services project that I'm working on and I'm unable to validate a Child Windows text input. I have a text box such as this one: <TextBox Height="23" Name="txtSummary" Width="Auto" Grid.Row="2" Grid.Column="4" Text="{Binding DocumentView.Summary, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidati...

Invariant dates with WCF RIA Services

Hi Is there any way to prevent Silverlight/RIA Services from converting a datetime object on the wire? Right now, I see datetimes set to 'Local' or 'Unspecified' being converted to the local time of the server when they are sent over the wire. For example: The client and server are both in UTC -04:00:00. I use DateTime.Today (kind ...

Get ErrorMessage from ResourceFile / RIA Services

Hi My goal is simply to show a language-specific errormessage for a Required-Annotation: [Required(ErrorMessageResourceName = "LastNameRequired", ErrorMessageResourceType = typeof(ValidationMessage))] LastNameRequired is the key of the string in the resourcefile, ValidationMessage is the type generated by the resource file. The resou...

Best approach: Set/change password dialog

Hi I have a usercontrol which is responsible for presenting creation and change of users. The usercontrol is bound to an entity delivered by a RIA Service: [MetadataType(typeof(User.UserMetadata))] public partial class User { internal class UserMetadata { protected UserMetadata() {} [Required] public st...

Child table loading with LinqToSql and RIA services

I am using LinqToSql on a project, and Ria services to expose it as an IQueryable. I want to send my Product table along with its child tables (e.g. ProductStatus, ProductCategory) To do this I am using the standard public IQueryable ProductSelect() { DataLoadOptions loadOpts = new DataLoadOptions(); loadOpts.LoadWith<Product>(p => p....

How to do a server-side Insert/Update (Upsert) from Silverlight RIA services

While RIA services seems very good for table operations & queries, I am stuck on one traditional update situation. The UPSERT (Update if exists, else Insert new): First: I want to add a record server-side if the record does not already exist, otherwise if it already exists, I want to update one of its current field values. Second: I do...

Silverlight 4 RIA datacontext error if I return less than 2 records....

Hey there, I am clueless in what is causing this but I get an error when my ria service if less than 2 items are been returned, everything works ok if I have 2 or more records been returned. My domain data source looks like this <riaControls:DomainDataSource AutoLoad="True" x:Name="dsEmployee" LoadedData="d...

Validation on subclasses

Hello. I've a small inheritance-tree like this: BaseGuest -> GuestA -> GuestB -> GuestC BaseGuest has a member 'Firstname' which is required for GuestA and GuestB, but not GuestC. So I've there are Required-Annotations on GuestA.Firstname and GuestB.Firstname. [Required(ErrorMessageResourceName = "FirstNameRequired", ErrorMessag...

Smart paging problem with RiaServices and entityQuery.IncludeTotalCount when filtering

Hello, I'm using RiaServices to populate a grid using an EntityQuery. Since my database has millions of rows, I want to query only the current page, but also to bring the total number of rows for paging purposes. Ex: 100 rows total entityQuery.Skip(0).Take(10); //for the first page entityQuery.IncludeTotalCount = true; That brings ...

EF4 Include not returning any of the navigation properties

Hi all, I am using this public IQueryable<Document> GetDocuments() { return this.ObjectContext.Documents.Include("Company").Include("PostingStatus").Include("DocumentType").Include("Period"); } in my domainservice but its not returning anything to the client i am using WCF RIA Services and EF4 and Silverlight. Doe...

RIA Services why does VS 2010 not generate an App.config when there is no EF model?

We always generate our RIA services as a "WCF RIA Services Class Library". When we generated one for POCO, without first adding an EF model, we noticed the App.config was not generated. After testing we found the settings are only added to App.config if the App.config file already exists in the project. Is this just a bug in VS 2010?...

How to make use of RIA Services App.config files (without copying settings to web.config)

Even though I link my web-app with my RIA Services.web library, the App.config setting files are never used and I always need to copy the module settings manually to my web.config. Am I doing something wrong? Should the App.config file be recognised and automatically loaded? ...

Making asynchronous calls in a RIA services method

I have a Silverlight 4 application using RIA services. One of the RIA service methods does something similar to the following: List<Foo> fooList = this.GetListOfFoo(); AnotherService aService = new AnotherService(); foreach (Foo foo in fooList) { aService.SomeMethodCompleted += this.methodCompleted; aService.SomeMethodAsync(foo);...

Getting user profile data in Silverlight 4

Hi All, I am fairly new to Silverlight and RIA services, and I am trying to build a small project to understand it. So basically I created a Business Application, and I have the normal Login screen where I can add a user. That is fine and I can add a user and get him into the aspnet_Users table. Now I have created some extra fields, ...

Silverlight 4: Business Application Template

Hello, I am developing a Silverlight 4 application which is based upon Business Application Template. I am interested to ask user to login and display a login form as soon as user arrives to my site. I need to makes sure that the user cannot see/navigate to any other page of the application until he/she logs in. Could you please help ...