AutoMapper.Extensions.Microsoft.DependencyInjection 12.0.1

Prefix Reserved
Suggested Alternatives

AutoMapper 13.0.0

Additional Details

The functionality of this package is now included directly in AutoMapper.

dotnet add package AutoMapper.Extensions.Microsoft.DependencyInjection --version 12.0.1
                    
NuGet\Install-Package AutoMapper.Extensions.Microsoft.DependencyInjection -Version 12.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
                    
Directory.Packages.props
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AutoMapper.Extensions.Microsoft.DependencyInjection --version 12.0.1
                    
#r "nuget: AutoMapper.Extensions.Microsoft.DependencyInjection, 12.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=AutoMapper.Extensions.Microsoft.DependencyInjection&version=12.0.1
                    
Install AutoMapper.Extensions.Microsoft.DependencyInjection as a Cake Addin
#tool nuget:?package=AutoMapper.Extensions.Microsoft.DependencyInjection&version=12.0.1
                    
Install AutoMapper.Extensions.Microsoft.DependencyInjection as a Cake Tool

AutoMapper extensions for Microsoft.Extensions.DependencyInjection

CI NuGet MyGet (dev)

Scans assemblies and:

  1. adds profiles to mapping configuration
  2. adds value resolvers, member value resolvers, type converters to the container.

To use, with an IServiceCollection instance and one or more assemblies:

services.AddAutoMapper(assembly1, assembly2 /*, ...*/);

or marker types:

services.AddAutoMapper(type1, type2 /*, ...*/);

This registers AutoMapper:

  • As a singleton for the MapperConfiguration
  • As a transient instance for IMapper
  • ITypeConverter instances as transient
  • IValueConverter instances as transient
  • IValueResolver instances as transient
  • IMemberValueResolver instances as transient
  • IMappingAction instances as transient

Mapping configuration is static as it is the root object that can create an IMapper.

Mapper instances are registered as transient. You can configure this with the serviceLifetime parameter. Be careful changing this, as Mapper takes a dependency on a factory method to instantiate the other extensions.

Mapper.Map usage

To map at runtime, add a dependency on IMapper:

public class EmployeesController {
	private readonly IMapper _mapper;

	public EmployeesController(IMapper mapper)
		=> _mapper = mapper;

	// use _mapper.Map to map
}

ProjectTo usage

Starting with 8.0 you can use IMapper.ProjectTo. The old ProjectTo is an extension method and does not have dependency injection available. Pass an IConfigurationProvider instance directly:

var orders = await dbContext.Orders
                       .ProjectTo<OrderDto>(_configurationProvider)
					   .ToListAsync();

Or you can use an IMapper instance:

var orders = await dbContext.Orders
                       .ProjectTo<OrderDto>(_mapper.ConfigurationProvider)
					   .ToListAsync();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (946)

Showing the top 5 NuGet packages that depend on AutoMapper.Extensions.Microsoft.DependencyInjection:

Package Downloads
Omnia.Fx.NetCore

Package Description

Elsa.Core

Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application. This package contains the core of Elsa. Tip: reference the `Elsa` package instead of this one.

Omnia.Fx.NetCore.Runtime

Package Description

FenixAlliance.ACL.Dependencies

Application Component for the Alliance Business Suite.

VirtoCommerce.ExperienceApiModule.Core

Experiene API functionality

GitHub repositories (188)

Showing the top 20 popular GitHub repositories that depend on AutoMapper.Extensions.Microsoft.DependencyInjection:

Repository Stars
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
dotnet-architecture/eShopOnWeb
Sample ASP.NET Core 8.0 reference application, now community supported: https://github.com/NimblePros/eShopOnWeb
Kareadita/Kavita
Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
anjoy8/Blog.Core
💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
jasontaylordev/NorthwindTraders
Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.
dotnetcore/DotnetSpider
DotnetSpider, a .NET standard web crawling library. It is lightweight, efficient and fast high-level web crawling & scraping framework
Ombi-app/Ombi
Want a Movie or TV Show on Plex/Emby/Jellyfin? Use Ombi!
fullstackhero/blazor-starter-kit
Clean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
dotnet/samples
Sample code referenced by the .NET documentation
ardalis/ApiEndpoints
A project for supporting API Endpoints in ASP.NET Core web applications.
grandnode/grandnode
Open source, headless, multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, Vue.js.
microsoft/sbom-tool
The SBOM tool is a highly scalable and enterprise ready tool to create SPDX 2.2 compatible SBOMs for any variety of artifacts.
lampo1024/DncZeus
DncZeus 是一个基于.NET 7 + Vue.js(iview-admin) 的前后端分离的通用后台权限(页面访问、操作按钮控制)管理系统框架。后端使用.NET 7 + EF Core构建,UI则是目前流行的基于Vue.js的iView(iview-admin)。项目实现了前后端的动态权限管理和控制以及基于JWT的用户令牌认证机制,让前后端的交互更流畅。码云镜像:https://gitee.com/rector/DncZeus 。演示地址(demo):
fullstackproltd/AspNetCoreSpa
Asp.Net 7.0 & Angular 15 SPA Fullstack application with plenty of examples. Live demo:
iammukeshm/CleanArchitecture.WebApi
An implementation of Clean Architecture for ASP.NET Core 3.1 WebAPI. Built with loosely coupled architecture and clean-code practices in mind.
AlphaYu/adnc
.NET微服务/分布式开发框架,同时也适用于单体架构系统的开发。
jbogard/ContosoUniversityDotNetCore-Pages
With Razor Pages
OfficeDev/Microsoft-Teams-Samples
Welcome to the Microsoft Teams samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Microsoft Teams App!
CXWorld/CapFrameX
Frametime capture and analysis tool
optimajet/WorkflowEngine.NET
WorkflowEngine.NET - component that adds workflow in your application. It can be fully integrated into your application, or be in the form of a specific service (such as a web service).
Version Downloads Last updated
12.0.1 54,619,293 4/9/2023 12.0.1 is deprecated because it is no longer maintained.
12.0.0 38,492,224 9/30/2022
11.0.0 45,592,600 1/5/2022
8.1.1 55,993,226 2/5/2021
8.1.0 13,971,932 10/14/2020
8.0.1 12,241,812 7/16/2020
8.0.0 801,118 7/9/2020
7.0.0 38,717,066 8/12/2019
6.1.1 5,165,103 6/4/2019
6.1.0 3,628,144 4/29/2019
6.0.0 11,808,646 11/18/2018
5.0.1 6,471,336 7/20/2018
4.0.1 5,654,074 6/18/2018
3.2.0 4,391,066 11/16/2017
3.1.0 268,175 10/26/2017
3.0.1 563,952 8/19/2017
2.0.1 1,003,584 3/30/2017
2.0.0 41,529 3/17/2017
1.2.0 210,467 12/29/2016
1.1.2 94,594 9/2/2016
1.1.0 211,707 8/11/2016
1.0.1-alpha 12,333 7/20/2016
1.0.0-alpha 3,227 7/20/2016