开发者

How to update only dirty fields in .NET entity framework when using stored procedures for insert,update,delete?

I use .NET entity framework and mapped my database tables to it. i used stored procedures for insert,update, delete.

then I used EntityDataSource in an ASP.NET application which updates a table.

I don't change all the fields of the entity. there are some fields left unused.

the problem is that when the EntityDataSource performs Update Command. It tries to update ALL fields in the entity. so unused fields receive wrong values.

Is There any simple solution us开发者_Go百科ing entity framework designer ?

for example can i use original values for non-modified fields?


Don't use a stored procedure.

Unfortunately that's the only answer I have. A SP expects to get the values it's putting in, you can't tell it to only call with some of the parameters filled in.

If you're just letting EF do the updates without a SP, it should be able to handle this more intelligently.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜