public async Task <long> Save(DebitBorrow entity) { _context.Entry(entity).State = entity.Id > 0 ? EntityState.Modified : EntityState.Added; await _context.SaveChangesAsync(); return(entity.Id); }
public async Task <long> Delete(long id) { DebitBorrow farm = await GetById(id); _context.DebitBorrows.Remove(farm); await _context.SaveChangesAsync(); return(id); }