What is the life cycle of a data context.
MyDB_DataContext db = new MyDB_DataContext();
Is it more efficient to pass one context across several methods or create new instances of it. OR is there any reason to choose one over the other
public void DoStuff(){
MyDB_DataContext db = new MyDB_DataContext();
doMoreStuff()
}
private void doMoreStuff(){
MyDB_DataContext db = new MyDB_DataContext();
return;
}
VS
public void DoStuff(){
MyDB_DataContext db = new MyDB_DataContext();
doMoreStuff(db)
}
private void doMoreStuff(MyDB_DataContext db){
return;
}