Ejemplo n.º 1
0
        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>);
        }
Ejemplo n.º 2
0
 public PetStoreRepository(PetStoreDBContext context)
 {
     petStoreContext = context;
 }
Ejemplo n.º 3
0
 public HomeController(PetStoreDBContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
        public ContextWrapper(PetStoreDBContext blogContext)
        {
            Table = Property <T> .AccessOnCompile(blogContext);

            PSContext = blogContext;
        }