1
I have the following tables in my database:
- Sale
- Detailing
- Productsresulture
- Plots
The relationship is as follows:
- 1 Sale => N Detail
- 1 Sale => N Productsrelations
- 1 Detail Spreads => N Plots
I’m trying to make the method to add a new sale, but I’m not getting results, the method does not give error, but when I check in the database, the record was not recorded.
The following is the code of my method:
public Venda LancamentoVenda(Venda obj)
{
Db.UpdateGraph(obj, map => map
.OwnedCollection(d => d.DetalhesVenda, r => r.AssociatedCollection(a => a.Parcelas))
.OwnedCollection(x => x.ProdutosVendas));
return obj;
}
Missing Db.Savechanges();
– Netinho Santos