public static DbSet <T> AccessOnCompile(PetStoreDBContext context) { Assembly executing = Assembly.GetExecutingAssembly(); Type ContextType = executing.GetType("PetStore.API.Db.PetStoreDBContext"); Type typeParameterType = typeof(T); PropertyInfo prop = ContextType.GetProperty(typeParameterType.Name); return(prop.GetValue(context) as DbSet <T>); }
public PetStoreRepository(PetStoreDBContext context) { petStoreContext = context; }
public HomeController(PetStoreDBContext context) { _context = context; }
public ContextWrapper(PetStoreDBContext blogContext) { Table = Property <T> .AccessOnCompile(blogContext); PSContext = blogContext; }