Example #1
0
 public GenericRepository(CarDbContext mainDbContext)
 {
     _context = mainDbContext;
     _dbSet   = _context.Set <TEntity>();
 }
 public void Add(T entity)
 {
     _db.Set <T>().Add(entity);
 }
Example #3
0
 public RepositoryBase(CarDbContext context)
 {
     _db    = context;
     _table = _db.Set <T>();
 }
Example #4
0
 public GenericRepository(CarDbContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
Example #5
0
 // GET: Series/Create
 public IActionResult Create()
 {
     ViewData["BrandID"] = new SelectList(_context.Set <Brand>(), "ID", "ID");
     return(View());
 }