ObjectContext disposed puzzle
- by jaklucky
Hi,
I have the follwing method.
public List<MyEntity> GetMyEntities(MyObjectContext objCtx)
{
using(MyObjectContext ctx = objCtx ?? new MyObjectContext())
{
retun ctx.MyEntities.ToList();
}
}
The idea is, user of this method can pass in the objectcontext if they have. If not then a new objectcontext will be…