2
I wonder if it is possible to search the object completely filled without calling the include
specifying each child object (with their respective children) of my class.
Currently, I’m doing so:
dbContext.Ocorrencia.Include("Pessoa")
.Include("Endereco")
.Include("Veiculo")
.Where(c => c.id == @id).ToList();
In this case, each child object will also have its own child object, generating a cascade. So I’m not finding this way to go including item by item elegant.
There is a way to insert all "children" into a single command. As if there were one
.IncludeAll()
for example.
I didn’t find any reference that would suit me well.
There is an answer to your question at this link: https://codereview.stackexchange.com/questions/30839/dbsett-includeall-method?answertab=oldest#tab-top
– Cassio Alves