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

PSA this.CreateMultiLingualMap() needs to be the last statement of the Profile #2

Open
jkkrause opened this issue Jun 28, 2022 · 0 comments

Comments

@jkkrause
Copy link

For anyone reading this, perhaps stumbling upon this issue. The this.CreateMultiLingualMap() needs to be the last statement of your Entity/Dto configuration.

        CreateMap<ScenarioCreateDto, Scenario>().IgnoreFullAuditedObjectProperties()
                                                .Ignore(x => x.Id)
                                                .Ignore(x => x.TenantId);

        CreateMap<ScenarioUpdateDto, Scenario>().IgnoreFullAuditedObjectProperties()
                                                .Ignore(x => x.Id)
                                                .Ignore(x => x.TenantId);

        CreateMap<ScenarioDto, ScenarioCreateDto>();
        CreateMap<ScenarioDto, ScenarioUpdateDto>();

        CreateMap<Scenario, ScenarioDto>();
        CreateMap<ScenarioDetails, ScenarioDetailsDto>();
        CreateMap<ScenarioTranslation, ScenarioTranslationDto>().ReverseMap(); // Needed for Updating!

        // If this statement is not last, the **BeforeMap** will **NOT** trigger!
        this.CreateMultiLingualMap<Scenario, ScenarioTranslation, ScenarioDetailsDto>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant