예제 #1
0
        public async Task <bool> Comit()
        {
            return(await _db.SaveChangesAsync() > 0);

            //try
            //{
            //   await _db.SaveChangesAsync();

            //    return true;
            //}
            //catch (Exception)
            //{

            //    return false;
            //}
        }
예제 #2
0
 public void Delete(T entity)
 {
     _context.Entry(entity).State = EntityState.Deleted;
     _context.SaveChangesAsync();
 }