Home > Net >  Ef core one-to-many configuration problems
Ef core one-to-many configuration problems

Time:09-24

, the following in efCore one-to-many configuration, and I found that all the queries are  , the permisson subset,
But if I only for a query, there is no data Permissons,
I watch the ef in the database to generate statements, supposedly query out all the time, simply select * from a, then has carried on the assembly in the memory, so there are Permissons data,
The question now is, I if only for a data, if it makes efCore against a one-to-many relationship in time, filling ICollection Permissons, the inside of the data? And for the great god

CodePudding user response:

Abandoning the EF, only will be more trouble, native ADO problem basically do not have to solve is fast,

CodePudding user response:

If you don't use the include to associate,
Then the associated objects need to Virtual, as if no matter whether the core,
And install the Microsoft. EntityFrameworkCore. Proxies,
(but I've never used this method,)

CodePudding user response:

Can try
Public virtual ICollection Permissons {get; set; }

The premise is foreign key ready in advance
  • Related