Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 78
Ahmed Mohamed Abdel-Razek edited this page Nov 10, 2024
·
2 revisions
Welcome to the AutoMapper.Collection wiki!
this how to use it in your asp core 8+ project
in the program.cs file add (after AddDbContext service if you are using AutoMapper.Collection.EntityFrameworkCore)
builder.Services.AddAutoMapper(cfg =>
{
// for collection
cfg.AddCollectionMappers();
// for entity framework core
cfg.UseEntityFrameworkCoreModel<DB>(builder.Services);
}, typeof(MappingProfile).Assembly);