I have the following tables in my database:
The relationship is as follows:
- 1 Sale = > N Sales Details
- 1 Sale = > N Products Sales
- 1 Sales Details = > N Plots
I'm trying to make the method to add a new sale, however I'm not getting results, the method does not give error, but when I go check in the database, the record has not been saved.
The following is the code for 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;
}