Search code examples
entity-framework-4concurrencywcf-ria-servicessilverlight-5.0

TimeStamp in RIA Services


Does RIA Services handle the updating of timestamp properties automatically?, i.e., When I Insert or Update, does the timestamp get updated without writing any extra code?, I figure that all I have to do is to define the timestamp property in sql server and then mark the property with the TimeStamp attribute in the corresponding Entity Data Model.


Solution

  • The scenario you depict should work (if entity framework is configured correctly) However, the update of TimeStamp properties is not a responsibility of WCF Ria Services. That info should be updated from your data layer.
    WCF Ria Services, however, will roundtrip the original value of any property that is decorated with either RoundTripOriginalAttribute or ConcurrencyCheckAttribute or TimestampAttribute back to the server when SubmitChanges is called, thus allowinf EF (or whether your orm/ data layer object is) to use this info for checking concurrency