示例#1
0
        public async Task <long> Save(DebitBorrow entity)
        {
            _context.Entry(entity).State = entity.Id > 0 ? EntityState.Modified : EntityState.Added;
            await _context.SaveChangesAsync();

            return(entity.Id);
        }
示例#2
0
        public async Task <long> Delete(long id)
        {
            DebitBorrow farm = await GetById(id);

            _context.DebitBorrows.Remove(farm);
            await _context.SaveChangesAsync();

            return(id);
        }