Last post May 14, 2012 09:30 PM by ThatsIT
May 13, 2012 07:25 AM|ThatsIT|LINK
I have been testing the concurrencycheck atrribute in a mvc 4 aplication, with no luck, i use sql profiler and do not see choosen properties in the where clause, marking the property concurrency fixed in the entity designer works fine, but i really want
to set by using attributes, is there someing i am missing. do i have to do more than add the attribute.
I ssume i have everything else correct as it all works fine if i mark the property fixed.
May 14, 2012 09:18 PM|Decker Dong - MSFT|LINK
do not see choosen properties in the where clause, marking the property concurrency fixed in the entity designer works fine
If you want to set Concurrency，I think you should set a public property like [TimeStamp]，with the property whose type is byte"；and then you should put the related codes into try……catch……，and the "catch" statement should be something like DbConcurrency
exception to catch such an exception when it is raised out。
For more about concurrency，you can refer this：http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/handling-concurrency-with-the-entity-framework-in-an-asp-net-mvc-application
May 14, 2012 09:22 PM|ThatsIT|LINK
I think it was the entity code generator i was using, it worked with self tracking code generator v5, but not with the dbcontext one.
i also want to track only certain properties, i dont care if others change so i did not want to use timestamp.
I dont now if this is a bug, or that it is not ment to work with dbcontect code generator?
User vs 11 beta
May 14, 2012 09:27 PM|Decker Dong - MSFT|LINK
Haha:D，for me it's hard to say，either……
Maybe you can feedback about VS beta products at：http://connect.microsoft.com。Please write down more about the steps of reproducing this kind of issue……
May 14, 2012 09:30 PM|ThatsIT|LINK
i may do that, i had to channge a fair bit of code in the controllers, to change code generators, so it was not a simple change.