一个DataContext或更多 [英] one DataContext or more
本文介绍了一个DataContext或更多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当处理linq到sql并实例化datacontext时
在所有函数中处理一个datacontext是否更好?或者我们应该在每个函数中实例化一个新的datacontext?
解决方案
Rick Strahl发布了一篇关于DataContext管理的好文章,可在此处找到: -
http ://weblog.west-wind.com/posts/2008/Feb/05/Linq-to-SQL-DataContext-Lifetime-Management
When Dealing with linq to sql and instantiating datacontext
Is it better to deal with one datacontext in all functions or we should
instantiate a new datacontext in each function ?
解决方案
Rick Strahl's has posted nice article about the DataContext management and its available here:-
http://weblog.west-wind.com/posts/2008/Feb/05/Linq-to-SQL-DataContext-Lifetime-Management
这篇关于一个DataContext或更多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文