Exemplo n.º 1
0
 public ChatRepository(ChatContext db)
 {
     _db    = db;
     _dbSet = db.Set <TEntity>();
 }
Exemplo n.º 2
0
 public GenericRepository(ChatContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }
Exemplo n.º 3
0
        public async Task CreateAsync(T item)
        {
            await _db.Set <T>().AddAsync(item);

            await _db.SaveChangesAsync();
        }
Exemplo n.º 4
0
 public BaseService(ChatContext context)
 {
     _db = context.Set <TEntity>();
 }
Exemplo n.º 5
0
        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>();
 }
Exemplo n.º 7
0
 public BaseRepository(ChatContext context)
 {
     _entity = context.Set <TEntity>();
 }