wcf-ria-services

Quick questions about updating code from RIA Services July Preview to RIA Services 1.0

I don't have much experience on the web services / database abstraction layer side of things for Silverlight, and am caught on an aspect of my porting effort. There was a core C# developer on the project that is no longer involved, and I'm working with code that he wrote. I'm updating code on a SL3 project with the RIA Services preview ...

Silverlight 4 application crashing rather than throwing exception

I have been using Shawn Wildermuths example and it has been working fine no problems at all. Today, however, I have added a few of my own Models and ViewModels and it still works. Problem appears when I start to add the attribute [RequiresAuthentication] into my DomainService. Although the code has exception handling, it prefers to cr...

RIA Services - Silverlight 4.0 - Accessing entities from code

Hello, I have strange situation I have simple project to test RIA functionality in Silverlight 4.0. When I use data source for Domain Service it works great but when I want to access Context from code and execute simple query I returns 0 rows. //test One with query provided to DataSource var q = ctx.GetDoctorsWithPatientsAndHospitalQu...

How do entity self-tracking with changes in VM and UI?

my context: Entity Framework 4.0 + WCF Ria Data Service + Silverlight 4. Suppose I have entity People from EF, then I created PeopleVM like: public class PeopleViewModel : ViewModelBase { public PeopleViewModel(){ //.... this._hasChanges = MyDomainContext.HasChanges; } private People _Peopl...

Silverlight 4 and RIA services

I am using Silverlight 4 and RIA services. I have a class called Request and it contains properties some of which are objects. The objects of the main class are not being created in the metadata class on the Silverlight client. I have already included the [Include] attribute over the objects on the server side. What am I doing wrong? ...

RIA services - is filtering done at the server or client?

Lets say I have some code like: ExampleDomainContext ctx = new ExampleDomainContext(); var query = from p in ctx.GetPeopleQuery() where p.Id > 2 select p; ctx.Load<Person>(query).Completed += (s, e) => { // do some stuff }; This is being done on the client, and the GetPeopleQuery() call from the RIA servi...

RIA-Services - how to WhereOr or use an IN style construct

I am using SL 4, WCF RIA Services against Entity Framework 4.0. I have an Entity, Visit, that has a string Status field. I have a search screen where I need to display results that have StatusA or StatusB. I am struggling to find a way to specify a client-side query that specifies a collection of statuses that should be matched. If I was...

How do you prevent a base class property from rendering in a DataForm?

Hello all, Please excuse this novice question, but I'm ramping up on Silverlight and MVVM Light. I created a view called MyView.xaml and a corresponding MyViewModel.cs. MyView.xaml <navigation:Page x:Class="Dashboard.Views.MyView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sch...

Check if RIA Services are accessible from OOB application.

I am attempting to add smart exception handling to a Silverlight 4 RIA application that is primarily consumed out-of-browser. My goal is to display a meaningful error window if RIA services are not currently accessible (e.g. The server is down for maintenance) Is there any facility built into RIA/SL for this task? ...

Can't Get EF4 Eager Loading of Subclassed Entities to Work

I have an abstract Content entity in my EF4 model with a concrete subclass, MultipleChoiceItem. There is a related table in the case of MultipleChoiceItem accessed by a Navigation property on the MultipleChoiceItem entity called Options. I would like to eager-load the Options result because if you're getting a MultipleChoiceItem, you alw...

Why can't get validation error display in validationSummary?

I have a form with some validations set in entity metadata class. and then binding entity instance to UI by VM. Something as below: Xaml like: <Grid x:Name="LayoutRoot"> <StackPanel VerticalAlignment="Top"> <input:ValidationSummary /> </StackPanel> <TextBox Text="{Binding Name, Mode=TwoW...

DomainContext Load

I tried to load a entity by domainservice(async) in on line of code like: context.Load<Book>( context.Books.Where(b => b.BookID == 1), (s, e) => { _book = e.Results; }, null); But I got following error: The type 'SilverlightApplication1.Book' cannot be used as type parameter 'TEntity' in the generic type or method 'System.Service...

RIA with Code First EF - Validating a new entity

My problem is that when I add a new entity with a required field, the entity doesn't show the validation error in the UI. I'm using using EF CTP4 Code First. My setup : I have an entity. public class Category { [Key] public int Id { get; set; } [Required] public string Name { get; set; } public string ImageUrl ...

WCF RIA Services Authorization

Hi guys, Assume we have two groups "Admins" and "Users". Admins are able to use any operation available in the service but the users can only use some of them. Should I add the "Admins" group to every single operation or if I just write it on top of the class will do the trick? Thanks. ...

MVVM / New Entity / Required Attribute / Validation before submitting

I am using the Required attribute on via the WCF RIA Services Metadata class, with the Entity Framework underneath that. I create a new entity, and let the view bind to the view model. User looks at it for awhile, clicks around, and then attempts to save it. The scenario here is that the user did not tab or click into a fields with a ...

Proper data access strategy for Silverlight / WCF RIA Services application

I have come to a cross roads and can't figure out the proper way to get lots of data for a form onto a Silverlight / WCF RIA Services application. Imagine an order form that you can update fields about the order (Billing information, etc.) and also other information that is read-only, payments to the order, order items, etc. The data...

How to implement IEditableObject for View Model?

Suppose I have VM with some entities as property. Say People, Addres, Phone, .... Then I want to implelemt IEditableObject on VM so that user have undo functionnality. What's the best way to implement request? Demo code please. ...

Submit operation failed - NotFound

I get this using SL 4 and RIA Services trying to save images to SQL Server using the Entity framework. The first few SubmitChanges() works then it fails with the above. Using fiddler I get the following: System.ServiceModel.CommunicationException: Unrecognized message version. at System.ServiceModel.Channels.ReceivedMessage.ReadStart...

Problem with WCF Ria Services RequiresRole attribute

I have a User class that implemented the IUser interface and is used in the AuthenticationService of my WCF RIA app. Whenever I apply the RequiresRole attribute to one of my operations I get Access to the operation is denied error even though WebContext.User.IsInRole("Managers") on the client side returns true. Does anyone know why I g...

Deployment of Silverlight RIA Services Application

Testing on local Web Development Server and running the application in shared hosting environment differs a lot. What are the best steps to deploy a Silverlight RIA Services Application on a shared hosting environment? ...