public async Task <T> Create(T entity) { EntityEntry dbEntityEntry = employeeDBContext.Entry(entity); var response = await employeeDBContext.Set <T>().AddAsync(entity); await employeeDBContext.SaveChangesAsync(); return(response.Entity); }
static void Main(string[] args) { using (var context = new EmployeeDBContext()) { var result = context.Set<Employee>().Include(x => x.Department).ToArray(); } }
public GenericRepository(EmployeeDBContext dbContext) { _dbContext = dbContext; _entities = _dbContext.Set <TEntities>(); }
public GenericRepository(EmployeeDBContext context) { dbContext = context; table = dbContext.Set <T>(); }
public GenericRepository() { dbContext = new EmployeeDBContext(); table = dbContext.Set <T>(); }
public GenericRepository(EmployeeDBContext context) { this.context = context; this.dbSet = context.Set <TEntity>(); }
public GenericRepository(EmployeeDBContext _context) { this._context = _context; table = _context.Set <T>(); }
public GenericRepository() { this._context = new EmployeeDBContext(); table = _context.Set <T>(); }
public Repository(EmployeeDBContext context) { Context = context; Table = Context.Set <T>(); }
public Repository() { Context = new EmployeeDBContext(); Table = Context.Set <T>(); }
public GenericRepository(EmployeeDBContext employeeDBContext) { EmployeeDBContext = employeeDBContext; DBSet = employeeDBContext.Set <TEntity>(); }
public Repository(EmployeeDBContext _context) { this._context = _context; table = _context.Set <TEntity>(); }