Skip to content
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);
Clone this wiki locally