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

Feature: AutoMapper should be configured to load all mapping profiles #1264

Closed
hocinehacherouf opened this issue Sep 19, 2022 · 0 comments · Fixed by #1306
Closed

Feature: AutoMapper should be configured to load all mapping profiles #1264

hocinehacherouf opened this issue Sep 19, 2022 · 0 comments · Fixed by #1306
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@hocinehacherouf
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, AutoMapper is configured to load specific mapping profiles

var mapperConfig = new MapperConfiguration(mc =>
{
_ = mc.CreateMap(typeof(AsyncPageable<>), typeof(List<>));
mc.AddProfile(new DevicePropertyProfile());
mc.AddProfile(new DeviceTagProfile());
mc.AddProfile(new DeviceModelProfile());
mc.AddProfile(new DeviceModelCommandProfile());
});
var mapper = mapperConfig.CreateMapper();
_ = services.AddSingleton(mapper);

Describe the solution you'd like
AutoMapper should be configured to load all mapping profiles within portal:

_ = services.AddAutoMapper(Assembly.GetExecutingAssembly());
@hocinehacherouf hocinehacherouf added enhancement New feature or request refinement labels Sep 19, 2022
@hocinehacherouf hocinehacherouf added this to the S41 milestone Oct 3, 2022
@hocinehacherouf hocinehacherouf moved this to 🚧 In Progress in IoT Hub Portal Oct 3, 2022
@hocinehacherouf hocinehacherouf self-assigned this Oct 3, 2022
@hocinehacherouf hocinehacherouf moved this from 🚧 In Progress to 💬 Ready for Review in IoT Hub Portal Oct 3, 2022
hocinehacherouf added a commit that referenced this issue Oct 4, 2022
)

* Enable AutoMapper dependency injection to load all profiles #1264

* Fix missing Mapper initialization
@hocinehacherouf hocinehacherouf moved this from 💬 Ready for Review to 🚀 Ready in IoT Hub Portal Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🚀 Ready
Development

Successfully merging a pull request may close this issue.

1 participant