I've shimmed my data context. Now I need to shim a table get(). I'm running into issues with ObjectSet, since I don't know how to shim it.
DataModel.Fakes.ShimMyEntities.Constructor = (inst) => {};
DataModel.Fakes.ShimMyEntities.AllInstances.Table1Get = (i)
=> ?
//In codebase
using(MyEntities ctx = new MyEntities())
{
ctx.Table1.ToList().ForEach(i => otherList.Add(i));
}
What should go where the question mark above is? I've tried variations of the following in place of the question mark but nothing so far works:
=> { return new ObjectSet<Table1>(){ new ObjectContext("").CreateObjectSet<Table1>();} ; }
and
=> { return System.Data.Objects.Fakes.ShimObjectContext.AllInstances.CreateObjectSetOf1String<Table1>(inst, var1) ???