public void Add(ServicoModels model)
 {
     using (PrestadorServicoContext context = new PrestadorServicoContext())
     {
         context.Servicos.Add(model);
         context.SaveChanges();
     }
 }
 public void Remove(ServicoModels model)
 {
     using (PrestadorServicoContext context = new PrestadorServicoContext())
     {
         var obj = context.Servicos.Find(model.ServicoId);
         context.Servicos.Remove(obj);
         context.SaveChanges();
     }
 }
Example #3
0
 public void Remove(FornecedorModels model)
 {
     using (PrestadorServicoContext context = new PrestadorServicoContext())
     {
         var obj = context.Fornecedores.Find(model.FornecedorId);
         context.Fornecedores.Remove(obj);
         context.SaveChanges();
     }
 }