Below is a function that converts the DBContext object to ObjectContext in C#.
How to Convert DBContext Object to ObjectContext in C# ?
public static ObjectContext ConvertContext(DbContext db) { return ((IObjectContextAdapter)db).ObjectContext; }
Below is a function that converts the DBContext object to ObjectContext in C#.
public static ObjectContext ConvertContext(DbContext db) { return ((IObjectContextAdapter)db).ObjectContext; }
Leave a Reply