ASP.NET Core [P18] :Using auto mapper with net core

Опубликовано: 23 Январь 2025
на канале: Moshax
107
9

ASP.NET Core Tutorial for Beginners

[P18] : Using auto mapper with net core
If you are wondering why is there a need to map objects. Well, a mapping like this is required when we pass data between different layers of an application. For example, when we pass data between data access, business and presentation layers of our application.

To use AutoMapper in an ASP.NET Core project, install AutoMapper.Extensions.Microsoft.DependencyInjection nuget package. This package has a dependency on AutoMapper, so it will also be installed.


In ConfigureServices method of the Startup class, add AutoMapper services.