开发者

We are using EntityFrame work in a singleton class ? - Not reflecting the DataBase changes in the front End

Our application is using Entity Framewo开发者_开发知识库rk(.net 3.5) and singleton . When i update in the back end through procedure. It is not reflecting in the entity context.

I tried with refresh - But it is not refreshing Foreign Key.

How to refresh the entire context in Entity Framework ?


Are you trying to Singleton the objectcontext object? I don't recommend that. It is better to instantiate a new objectcontext for each "unit of work." If you do that, your "entity context" will always be up to date.

http://blogs.msdn.com/alexj/archive/2009/05/07/tip-18-how-to-decide-on-a-lifetime-for-your-objectcontext.aspx

Instantiating a context in LINQ to Entities

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜