public async Task Create(ComportamientosSind model) { try { _db.comportamientosSind.Add(model); await _db.SaveChangesAsync(); } catch (Exception e) { throw new Exception(e.Message, e); } }
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); } }
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); } }