Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to set the order in which the configuration is applied from the assembly #21304

Closed
sergiohms opened this issue Jun 17, 2020 · 1 comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported type-enhancement

Comments

@sergiohms
Copy link

What problem are you trying to solve?

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)
    {
        // ...
    }
}
@ajcvickers
Copy link
Contributor

@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.

@ajcvickers ajcvickers added the closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. label Jun 22, 2020
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported type-enhancement
Projects
None yet
Development

No branches or pull requests

2 participants