Exemple #1
0
 public static async Task DeleteAsync(TEntity entity)
 {
     using (var db = new DEAContext())
     {
         db.Set <TEntity>().Remove(entity);
         await db.SaveChangesAsync();
     }
 }
Exemple #2
0
        public static async Task InsertAsync(TEntity entity)
        {
            using (var db = new DEAContext())
            {
                await db.Set <TEntity>().AddAsync(entity);

                await db.SaveChangesAsync();
            }
        }