Ejemplo n.º 1
0
 public async Task <bool> Save(TipoGallo entity)
 {
     if (entity.Id > 0)
     {
         return(await Update(entity));
     }
     else
     {
         return(await Add(entity));
     }
 }
Ejemplo n.º 2
0
        //Update
        public async Task <bool> Update(TipoGallo entity)
        {
            _context.Entry(entity).State = EntityState.Modified;

            return(await _context.SaveChangesAsync() > 0);
        }
Ejemplo n.º 3
0
        //Insert
        public async Task <bool> Add(TipoGallo entity)
        {
            _context.TipoGallos.Add(entity);

            return(await _context.SaveChangesAsync() > 0);
        }