public async Task <long> Save(CreditBorrow 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) { CreditBorrow farm = await GetById(id); _context.CreditBorrows.Remove(farm); await _context.SaveChangesAsync(); return(id); }