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
{{ message }}
Repository navigation
Be able to set the order in which the configuration is applied from the assembly #21304
When applying the entity types configuration using ApplyConfigurationsFromAssembly, I obtain an exception because an A entity's configuration depends on a B entity's configuration which is executed later. The exception message says I must set a shadow property to B (which I do) but since A's configuration is applied first, then it doesn't work. When I change B's name so that is is alphabetically ordered first than A, it works.
Describe the solution you'd like
I think the order could be specified by an attribute. Something like:
[EntityConfiguration(Order=0)]
public class PlayerConfiguration : IEntityTypeConfiguration<Player>
{
public virtual void Configure(EntityTypeBuilder<Player> builder)
{
// ...
}
}
@sgioh We're not big fans of assembly scanning for this in general--see comments on #13014 and #13088. We discussed the request here, but decided that we don't want to add additional features to the scanning code. Instead we recommend using your own scanner, as shown in the linked issues, where you can do whatever ordering, etc. is needed for your case.
Activity
ajcvickers commentedon Jun 22, 2020
@sgioh We're not big fans of assembly scanning for this in general--see comments on #13014 and #13088. We discussed the request here, but decided that we don't want to add additional features to the scanning code. Instead we recommend using your own scanner, as shown in the linked issues, where you can do whatever ordering, etc. is needed for your case.