Considering that I use code like (with or without using (considering that using(??) may dispose context)):
IQueryable<Konsultanci> listaKonsultantow;
using (var context = new EntityBazaCRM(Settings.sqlDataConnectionDetailsCRM)) {
listaKonsultantow = from k in context.Konsultancis
select k;
}
Can I somehow extract context that was used from Konsultanci object later on so I don't have to store context on top of the class?
foreach (Konsultanci test in listaKonsultantow) {
// get context here?
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…