Reputation: 12369
So, here is the situation -
So has anyone faced a similar issue anytime ? What am I doing wrong here ?
Upvotes: 0
Views: 7070
Reputation: 19842
The problem is that the EF does not know what your stored procedure is doing, how could it? That work is done at the SQL Server. So after your stored procedure executes, you need to ask EF to update that (and other related) instance by issuing a Refresh()
call:
context.Refresh(RefreshMode.StoreWins, myObject);
The StoreWins
tells the framework to overwrite values in the instance with values from the database.
Upvotes: 6