public async Task <bool> Save(TipoGallo entity) { if (entity.Id > 0) { return(await Update(entity)); } else { return(await Add(entity)); } }
//Update public async Task <bool> Update(TipoGallo entity) { _context.Entry(entity).State = EntityState.Modified; return(await _context.SaveChangesAsync() > 0); }
//Insert public async Task <bool> Add(TipoGallo entity) { _context.TipoGallos.Add(entity); return(await _context.SaveChangesAsync() > 0); }