Esempio n. 1
0
 public async Task Create(ComportamientosSind model)
 {
     try
     {
         _db.comportamientosSind.Add(model);
         await _db.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
Esempio n. 2
0
        public async Task UpdateEstado(ComportamientosSind obj)
        {
            try
            {
                var _obj = await _db.comportamientosSind.FirstOrDefaultAsync(e => e.id == obj.id);

                if (_obj != null)
                {
                    _obj.estado = obj.estado;
                    await _db.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
Esempio n. 3
0
        public async Task Update(ComportamientosSind model)
        {
            try
            {
                var _model = await _db.comportamientosSind.FirstOrDefaultAsync(e => e.id == model.id);

                if (_model != null)
                {
                    _db.Entry(_model).CurrentValues.SetValues(model);
                    await _db.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }