Click here to Skip to main content
14,455,338 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi! I need to write Client/Server Application and I want to use LINQ Entities to send them over WCF to client. But when client would modify some data and send them back to the Server. I cant use built in LINQ to SQL concurrent access control. How I can realize concurrent access control?
Posted
Updated 6-Aug-10 22:29pm
v2

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Hi,

1) To send the entities over the net, you need to decorate the entities by using DataContract attribute and the fields by DataMember attribute.
2) For concurrency, follow these steps
1) when you are getting the data from the back end to the client side, get the last modified field.
2) From the client side, fill the entity with the latest value
3) Along with all the other fields, send the last modified field
4) In your update statements(LINQ) include the where clause for this last modified
5) Check how many rows got affected
6) If it is more than one, then success (No cocurrency issues)
7) If it is zero, then some concurrency issues

I hope this helps!.

Regards,
-Vinayak
   
Comments
   
Reason for my vote of 5
Good one
Xgener 10-Aug-10 9:42am
   
Vinayak thaks for answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100