public async Task <bool> Comit() { return(await _db.SaveChangesAsync() > 0); //try //{ // await _db.SaveChangesAsync(); // return true; //} //catch (Exception) //{ // return false; //} }
public void Delete(T entity) { _context.Entry(entity).State = EntityState.Deleted; _context.SaveChangesAsync(); }