In LINQ-SQL, wrap the DataContext is an using statement - pros cons

前端 未结 5 1492
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 10:41

Can someone pitch in their opinion about pros/cons between wrapping the DataContext in an using statement or not in LINQ-SQL in terms of factors as performance, memory usage, ea

5条回答
  •  抹茶落季
    2021-02-02 11:16

    Well, It's an IDisposable, so I guess it's not a bad idea. The folks at MSFT have said that they made DataContexts as lightweight as possible so that you may create them with reckless abandon, so you're probably not gaining much though.....

提交回复
热议问题