NetPro.AutoMapper
6.0.16
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
dotnet add package NetPro.AutoMapper --version 6.0.16
NuGet\Install-Package NetPro.AutoMapper -Version 6.0.16
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="NetPro.AutoMapper" Version="6.0.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPro.AutoMapper --version 6.0.16
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetPro.AutoMapper, 6.0.16"
#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.
// Install NetPro.AutoMapper as a Cake Addin #addin nuget:?package=NetPro.AutoMapper&version=6.0.16 // Install NetPro.AutoMapper as a Cake Tool #tool nuget:?package=NetPro.AutoMapper&version=6.0.16
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NetPro.AutoMapper使用
引用此nuget包即可自动实现各种注册配置,引用后直接按下方步骤使用即可,无需再关心初始化等操作 备注:默认增强启动模式,故需要入口处添加以下代码,如果以脚手架创建的项目可忽略此设置
Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", "NetPro.Startup");
- 1、配置映射关系 继承IOrderedMapperProfile以实现批量注册
/// <summary>
/// 实体之间隐射配置
/// 数据库实体与AO业务实体互相映射
/// </summary>
public class UserMapper : Profile, IOrderedMapperProfile
{
/// <summary>
///
/// </summary>
public UserMapper()
{
//数据库实体映射AO业务实体,ReverseMap可实现双向映射
CreateMap<UserInsertAo, User>().ReverseMap();
CreateMap<UserUpdateAo, User>().ReverseMap();
}
/// <summary>
/// 映射顺序,默认0即可,无需更改
/// </summary>
public int Order => 0;
}
- 2、使用automapper映射转换
public class FreeSQLDemoService : IFreeSQLDemoService
{
private readonly IMapper _mapper;
/// <summary>
///
/// </summary>
/// <param name="logger"></param>
/// <param name="fsql"></param>
/// <param name="idleFsql"></param>
/// <param name="mapper"></param>
public FreeSQLDemoService(IMapper mapper)
{
_mapper = mapper;
}
public void InsertAsync(UserInsertAo userInsertAo)
{
//AO实体隐射为数据库DO实体
var userEntity = _mapper.Map<UserInsertAo, User>(userInsertAo);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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. |
.NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- AutoMapper.Extensions.Microsoft.DependencyInjection (>= 11.0.0)
- NetPro.Startup (>= 6.0.16)
-
net6.0
- AutoMapper.Extensions.Microsoft.DependencyInjection (>= 11.0.0)
- NetPro.Startup (>= 6.0.16)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on NetPro.AutoMapper:
Repository | Stars |
---|---|
LeonKou/NetPro
🌈An enhanced version with clean architecture of asp.netcore,efficiently manage startup,Support for netcore3.1/6.0
|
Version | Downloads | Last updated |
---|---|---|
6.0.16 | 317 | 7/24/2023 |
6.0.15 | 722 | 7/19/2022 |
6.0.14 | 451 | 7/10/2022 |
6.0.13 | 474 | 6/15/2022 |
6.0.12 | 422 | 6/15/2022 |
6.0.11 | 391 | 6/15/2022 |
6.0.10 | 431 | 6/11/2022 |
6.0.9 | 417 | 6/8/2022 |
6.0.8 | 490 | 5/26/2022 |
6.0.8-beta.3 | 153 | 5/24/2022 |
6.0.8-beta.2 | 118 | 5/24/2022 |
6.0.7 | 447 | 5/18/2022 |
6.0.6 | 439 | 4/28/2022 |
6.0.5 | 444 | 3/30/2022 |
6.0.5-beta.20 | 123 | 4/27/2022 |
6.0.5-beta.19 | 123 | 4/25/2022 |
6.0.5-beta.18 | 129 | 4/22/2022 |
6.0.5-beta.17 | 135 | 4/16/2022 |
6.0.5-beta.16 | 200 | 4/8/2022 |
6.0.5-beta.15 | 128 | 4/8/2022 |
6.0.5-beta.14 | 140 | 4/7/2022 |
6.0.5-beta.13 | 139 | 4/7/2022 |
6.0.5-beta.12 | 127 | 4/6/2022 |
6.0.5-beta.11 | 159 | 4/6/2022 |
6.0.5-beta.10 | 152 | 3/31/2022 |
6.0.5-beta.9 | 141 | 3/26/2022 |
6.0.5-beta.8 | 154 | 3/22/2022 |
6.0.5-beta.7 | 139 | 3/21/2022 |
6.0.5-beta.6 | 149 | 3/14/2022 |
6.0.5-beta.5 | 149 | 3/2/2022 |
6.0.5-beta.4 | 146 | 2/22/2022 |
6.0.5-beta.3 | 143 | 2/18/2022 |
6.0.5-beta.2 | 135 | 2/18/2022 |
6.0.5-beta.1 | 136 | 2/16/2022 |
6.0.4 | 482 | 2/10/2022 |
6.0.3-beta.9 | 127 | 2/10/2022 |