Is there any way to register additional maps within umbraco, currently im struggling to get my mappers to work, first i initialize them on application starting.
protected override void OnApplicationStarting(object sender, EventArgs e)
{
base.OnApplicationStarting(sender, e);
GlobalConfiguration.Configure(WebApiConfig.Register);
AutoMapperWebConfiguration.Configure();
}
public static class AutoMapperWebConfiguration
{
public static void Configure()
{
Mapper.Initialize(cfg =>
{
cfg.AddProfile(new UserProfile());
});
}
}
public class UserProfile : Profile
{
protected override void Configure()
{
Mapper.CreateMap<Case, CaseDTO>();
}
}
Any Ideas why this is failing to register i had the idea umbraco maybe was overwriting my maps.
Thank you for the answer, i ended up fixing it with onapplicationStarted, i guess automapper wasnt initialized yet, so this would be the correct answer, applying high fives :)
Creating additional Automapper maps in umbraco
Helloooo umbraco
Is there any way to register additional maps within umbraco, currently im struggling to get my mappers to work, first i initialize them on application starting.
Any Ideas why this is failing to register i had the idea umbraco maybe was overwriting my maps.
Thanks in advance :)
I do it on OnApplicationInitialized (implementing IApplicationEventHandler) What kind of error did you have?
Thank you for the answer, i ended up fixing it with onapplicationStarted, i guess automapper wasnt initialized yet, so this would be the correct answer, applying high fives :)
is working on a reply...