![]() |
VOOZH | about |
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
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />Directory.Packages.props
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" />Project file
paket add AutoMapper.Extensions.Microsoft.DependencyInjection --version 12.0.1
#r "nuget: AutoMapper.Extensions.Microsoft.DependencyInjection, 12.0.1"
#:package AutoMapper.Extensions.Microsoft.DependencyInjection@12.0.1
#addin nuget:?package=AutoMapper.Extensions.Microsoft.DependencyInjection&version=12.0.1Install as a Cake Addin
#tool nuget:?package=AutoMapper.Extensions.Microsoft.DependencyInjection&version=12.0.1Install as a Cake Tool
Scans assemblies and:
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:
MapperConfigurationIMapperITypeConverter instances as transientIValueConverter instances as transientIValueResolver instances as transientIMemberValueResolver instances as transientIMappingAction instances as transientMapping 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.
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
}
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
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 |
|
|
VirtoCommerce.ExperienceApiModule.Core
Experiene API functionality |
|
|
FenixAlliance.ACL.Dependencies
Application Component for the Alliance Business Suite. |
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).
|
|
|
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.
|
|
|
dotnet-architecture/eShopOnWeb
Sample ASP.NET Core 8.0 reference application, now community supported: https://github.com/NimblePros/eShopOnWeb
|
|
|
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!
|
|
|
dotnet/samples
Sample code referenced by the .NET documentation
|
|
|
fullstackhero/blazor-starter-kit
Clean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
|
|
|
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.
|
|
|
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.
|
|
|
CXWorld/CapFrameX
Frametime capture and analysis tool
|
|
|
HenJigg/wpf-abp
Cross-platform mobile project and WPF client based on ABP framework Xamarin.Forms
|
|
|
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).
|
|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
|
|
dotnetzoom/AspNetCore-WebApi-Course
🥇 Professional REST API design with ASP.NET Core WebAPI
|
|
|
Amitpnk/Onion-architecture-ASP.NET-Core
WhiteApp API solution template which is built on Onion Architecture with all essential feature using .NET 8!
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 12.0.1 | 82,854,606 | 4/9/2023 | 12.0.1 is deprecated because it is no longer maintained. |
| 12.0.0 | 48,921,996 | 9/30/2022 | |
| 11.0.0 | 51,551,287 | 1/5/2022 | |
| 8.1.1 | 61,808,980 | 2/5/2021 | |
| 8.1.0 | 14,844,105 | 10/14/2020 | |
| 8.0.1 | 13,150,789 | 7/16/2020 | |
| 8.0.0 | 885,682 | 7/9/2020 | |
| 7.0.0 | 41,241,274 | 8/12/2019 | |
| 6.1.1 | 5,609,018 | 6/4/2019 | |
| 6.1.0 | 4,042,497 | 4/29/2019 | |
| 6.0.0 | 12,665,840 | 11/18/2018 | |
| 5.0.1 | 6,918,047 | 7/20/2018 | |
| 4.0.1 | 6,284,631 | 6/18/2018 | |
| 3.2.0 | 4,825,078 | 11/16/2017 | |
| 3.1.0 | 327,410 | 10/26/2017 | |
| 3.0.1 | 641,381 | 8/19/2017 | |
| 2.0.1 | 1,078,190 | 3/30/2017 |