How to use Graphdiff Entity Framework Code First

Asked

Viewed 36 times

1

I have the following tables in my database:

  1. Sale
  2. Detailing
  3. Productsresulture
  4. 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;
}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.