Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 21:29pm
v2

1 solution

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
 
Share this answer
 
Comments
vinayakshenoy2000@gmail.com 6-Aug-10 4:55am    
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900