Esempio n. 1
0
        public async Task <bool> CreateAndSaveEntityAsync <T>(T entity) where T : class
        {
            await context.Set <T>().AddAsync(entity);

            return(await this.SaveChangesAsync());
        }
 public EventRepository(EventDbContext db)
 {
     dbContext = db;
     entities  = dbContext.Set <T>();
 }
Esempio n. 3
0
 public EntityRepository(EventDbContext context)
 {
     _db   = context;
     dbSet = _db.Set <TEntity>();
 }