开发者

How do I detect field changes in EF?

开发者 https://www.devze.com 2023-01-10 04:19 出处:网络
I开发者_开发技巧n EF4, I want to know if some fields has been changed. How can I do that?var propertyFooIsModified =

I开发者_开发技巧n EF4, I want to know if some fields has been changed. How can I do that?


var propertyFooIsModified = 
    Context.ObjectStateManager.GetObjectStateEntry(someEntity)
                              .GetModifiedProperties.Any(p => p == "Foo");
0

精彩评论

暂无评论...
验证码 换一张
取 消