For example, I have 2 methods that use one DataContext (Linq to sql).
using(DataContext data = new DataContext){ // doing something another_datamethod(data); } void another_datamethod(DataContext data){ // doing }
Use this style? Or with the same result, I can create a separate “using DataContext”. What benefits will I get if I use one DataContext? Perhaps some cache features?
, " ", DataContext - , , . LINQ-to-SQL, "" DataContext. , , ... , , , . , ...
, , . DataContext DataContext. , , , data-dom DataContext. , , . , , -. , - , LINQ-to-SQL , . , , Pro LINQ: # 2008 . -. LINQ-to-SQL , , .
, DataContext ... . , , - .
Datacontexts , , - , .
Source: https://habr.com/ru/post/1727343/More articles:The best way to write this query is sqlzend locale makes me nervous: wrong date presentation - phpdate is not stored in mysql database - mysqlDoes the overflow-y: scroll property help prevent horizontal shift in Opera / Safari? - cssCygwin и Java - javaCheck Delay EasyMock - javaActionScript 3: Do you need to remove EventListeners? - actionscript-3How to check access to project boundaries in Maven projects - javawhat is the data.foo syntax in JSF / Rich Faces - ajaxVSTO C #: how to disable a pop-up window (tooltip) on a ribbon button - buttonAll Articles