public bool ResponderChamado(Chamado chamado) { using (var ctx = new ChamadosContext()) { ctx.Entry <Chamado>(chamado).State = System.Data.Entity.EntityState.Modified; } }
public IEnumerable <Chamado> BuscarChamados() { using (var ctx = new ChamadosContext()) { return(ctx.Chamados.ToList <Chamado>()); } }
public bool GravarChamado(Chamado chamado) { using (var ctx = new ChamadosContext()) { try { ctx.Chamados.Add(chamado); ctx.SaveChanges(); return(true); } catch (Exception) { return(false); } } }