You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have an aggregate, and I want to know what is the ordering algorithm in calling constructor of the entity?
Should I have a parameter constructor always in my aggregate? In many sample codes, for example here and here, I see this parameterless constructor. Maybe the reason of defining a parameterless constructor is that, in their parameters constructor they have some class as parameter and ef can't map them correctly, so for bypassing this parameter constructor they defined a parameterless one.
Does support injection class (navigation property classes) in entity type of .net 7, or it is in .net 8 plans?
@mehdihadeli EF doesn't need a parameterless constructor, but it does need a constructor with parameters that set only mapped properties of the entity, and not also other referenced entity instances. It's difficult to tell how your properties are mapped in the example code above, but if they are all owned typed--which means the parameters are all different entity instances--then EF can't currently can't set those in the constructor--this is tracked by #12078.
Hi,
I have an aggregate, and I want to know what is the ordering algorithm in calling constructor of the entity?
Should I have a parameter constructor always in my aggregate? In many sample codes, for example here and here, I see this parameterless constructor. Maybe the reason of defining a parameterless constructor is that, in their parameters constructor they have some class as parameter and ef can't map them correctly, so for bypassing this parameter constructor they defined a parameterless one.
Does support injection class (navigation property classes) in entity type of .net 7, or it is in .net 8 plans?
This is my
AggregateRoot
class:Include provider and version information
EF Core version:
Database provider: (e.g. Microsoft.EntityFrameworkCore.PostgreSql)
Target framework: (e.g. .NET 7.0)
The text was updated successfully, but these errors were encountered: