Example #1
0
        public async Task AddAsync(TEntity entity)
        {
            using var context = new UdemyBlogWebSiteContext();
            await context.AddAsync(entity);

            await context.SaveChangesAsync();
        }
Example #2
0
 public async Task DeleteAsync(TEntity entity)
 {
     using var context = new UdemyBlogWebSiteContext();
     context.Remove(entity);
     await context.SaveChangesAsync();
 }