public void InserirVinculo(VinculoClienteProduto vinculo) { try { using (var context = new TesteStefaniniEntities1()) { context.Entry(vinculo).State = EntityState.Added; context.VinculoClienteProduto.Add(vinculo); context.SaveChanges(); } } catch (Exception ex) { throw ex; } }
public void Inserir(Cliente cliente) { try { using (var context = new TesteStefaniniEntities1()) { context.Entry(cliente).State = EntityState.Added; context.Cliente.Add(cliente); context.SaveChanges(); } } catch (Exception ex) { throw ex; } }
public void Inserir(Produto produto) { try { using (var context = new TesteStefaniniEntities1()) { context.Entry(produto).State = EntityState.Added; context.Produto.Add(produto); context.SaveChanges(); } } catch (Exception ex) { throw ex; } }