Set them client-side to some dummy values inside entity OnCreated

Regards, Sergey

From: ozsilverlight-boun...@ozsilverlight.com 
[mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of David Burela
Sent: Friday, March 02, 2012 11:18 AM
To: ozSilverlight
Subject: Ria services, Data annotations

I've got a weird problem.

There are tables in a database with these additional columns "CreatedById", 
"ModifiedById". (They are nvarchar, not null)
There is then an entity framework model for this (again, strings, not null).
RIA services is used to share the entities with the client.

The problem is in Silverlight side. If I create a new Product class, display it 
in a Dataform to allow the user to edit price, etc. I can't submit product to 
the domain service because validation fails "CreatedById can not be null". It 
makes no sense to set those values on the client side as they could spoof those 
files. I have logic on the domain service side that looks at the current 
authenticated user and automatically sets those fields.

But I can't submit them because validation keeps failing on those 2 fields.
Is there a [NotRequired] property I could put on the domain service metadata 
file?
-David Burela
_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to