use AutoMapper in asp.net core code example
Example: install automapper asp.net core mvc
Install-Package AutoMapper.Extensions.Microsoft.DependencyInjection -Version 7.0.0
Install-Package AutoMapper.Extensions.Microsoft.DependencyInjection -Version 7.0.0