tags:

views:

183

answers:

1

Hi,

I am using RIA Services Beta 2 with Linq2Sql and SL3. In my SL3, I have a datagrid where I can do some mappings of data (Updates, Inserts and Deletes). I override the Submit method when SubmitChanges() is called. In the submit method in the domain service, I do some validation. If a validation fails for a particular ChangeSetEntry in the ChangeSet, a ValidationErrors is added. Then I call the base.Submit(changeSet).

So, if the changeset has 3 entities and one of the entities results in validation error, the other 2 entities are also rolled back. It looks like, RIA Services does an implicit transaction and hence it either submits all 3 or none even if 2 out of 3 does not have any validation error. Is there a way for the RIA service, to prevent rollback of the valid entities and only invalidate the ones that has validation failed.

Inputs will be appreciated.

Thanks Mohit

A: 

First I am a bit confused as to how or why you are using SL3 because it was only supported with Beta 1.

Is there a reason for not using the built in validation? If you did most validation would be caught client side and could be corrected before the server submit.

You might be able to achieve what you want by overriding the PersistChangeSet method but I would worry about keeping your client in sync with the server if only some of the entities are persisted.

http://weblogs.asp.net/fredriknormen/archive/2009/12/29/wcf-ria-services-domainservice-life-cycle-and-adding-transactions.aspx

JosephC