public ChatRepository(ChatContext db) { _db = db; _dbSet = db.Set <TEntity>(); }
public GenericRepository(ChatContext context) { this.context = context; this.dbSet = context.Set <TEntity>(); }
public async Task CreateAsync(T item) { await _db.Set <T>().AddAsync(item); await _db.SaveChangesAsync(); }
public BaseService(ChatContext context) { _db = context.Set <TEntity>(); }
public void Add(T entity) { entity.Created = entity.LastUpdated = DateTime.UtcNow; _context.Set <T>().Add(entity); }
public Repository(ChatContext context) { this.context = context; this.dbSet = context.Set <T>(); }
public BaseRepository(ChatContext context) { _entity = context.Set <TEntity>(); }