PocoEmit.Mapper 0.8.7-alpha

This is a prerelease version of PocoEmit.Mapper.
dotnet add package PocoEmit.Mapper --version 0.8.7-alpha
                    
NuGet\Install-Package PocoEmit.Mapper -Version 0.8.7-alpha
                    
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="PocoEmit.Mapper" Version="0.8.7-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PocoEmit.Mapper" Version="0.8.7-alpha" />
                    
Directory.Packages.props
<PackageReference Include="PocoEmit.Mapper" />
                    
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 PocoEmit.Mapper --version 0.8.7-alpha
                    
#r "nuget: PocoEmit.Mapper, 0.8.7-alpha"
                    
#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.
#:package PocoEmit.Mapper@0.8.7-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PocoEmit.Mapper&version=0.8.7-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PocoEmit.Mapper&version=0.8.7-alpha&prerelease
                    
Install as a Cake Tool

Emit映射工具

转化和复制POCO对象

一、转化

1. 直接转化

调用Convert方法

var user = new User { Id = 1, Name = "Jxj" };
// 转化
var dto = Mapper.Default.Convert<User, UserDTO>(user);
// dto.Id = 1, dto.Name = "Jxj"

2. 用委托

调用GetConvertFunc方法

var user = new User { Id = 1, Name = "Jxj" };
var dto = new UserDTO();
Func<User, UserDTO> convertFunc = Mapper.Default.GetConvertFunc<User, UserDTO>();
// 转化
var dto = convertFunc(user);
// dto.Id = 1, dto.Name = "Jxj"

3. 用接口

调用GetConverter方法

var user = new User { Id = 1, Name = "Jxj" };
IPocoConverter<User, UserDTO> converter = Mapper.Default.GetConverter<User, UserDTO>();
// 转化
var dto = converter.Convert(user);
// dto.Id = 1, dto.Name = "Jxj"

二、复制

1. 直接复制

调用Copy方法

var user = new User { Id = 1, Name = "Jxj" };
var dto = new UserDTO();
// 复制属性
Mapper.Default.Copy(user, dto);
// dto.Id = 1, dto.Name = "Jxj"

2. 用委托

调用GetCopyAction方法

var user = new User { Id = 1, Name = "Jxj" };
var dto = new UserDTO();
Action<User, UserDTO> copyAction = Mapper.Default.GetCopyAction<User, UserDTO>();
// 复制属性
copyAction(user, dto);
// dto.Id = 1, dto.Name = "Jxj"

3. 用接口

调用GetCopier方法

var user = new User { Id = 1, Name = "Jxj" };
var dto = new UserDTO();
IPocoCopier<User, UserDTO> copier = Mapper.Default.GetCopier<User, UserDTO>();
// 复制属性
copier.Copy(user, dto);
// dto.Id = 1, dto.Name = "Jxj"
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 is compatible.  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 is compatible.  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 is compatible.  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.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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 (6)

Showing the top 5 NuGet packages that depend on PocoEmit.Mapper:

Package Downloads
PocoEmit.Mapper.DI

Emit加速操作属性和字段

PocoEmit.Collections

Emit操作集合

PocoEmit.Mvc

Mapper支持Mvc注入

PocoEmit.ServiceProvider

Mapper支持注入

PocoEmit.Dictionaries

Emit操作集合

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.7-alpha 41 1/19/2026
0.8.6-alpha 52 1/11/2026
0.8.5-alpha 146 12/24/2025
0.8.4-alpha 142 12/24/2025
0.8.3-alpha 139 12/22/2025
0.8.2-alpha 123 12/21/2025
0.8.1.2-alpha 624 12/3/2025
0.8.1-alpha 126 11/28/2025
0.8.0-alpha 194 11/16/2025
0.7.0-alpha 100 10/3/2025
0.6.3.8-alpha 127 9/28/2025
0.6.3.7-alpha 84 9/28/2025
0.6.3.6-alpha 83 9/27/2025
0.6.3.5-alpha 103 9/26/2025
0.6.3.4-alpha 147 9/26/2025
0.6.3.3-alpha 158 9/25/2025
0.6.3.2-alpha 167 9/22/2025
0.6.3.1-alpha 176 9/22/2025
0.6.3-alpha 279 9/18/2025
0.6.2.1-alpha 166 9/4/2025
0.6.2-alpha 155 9/4/2025
0.6.1.1-alpha 186 8/28/2025
0.6.1-alpha 195 8/28/2025
0.6.0.3-alpha 190 8/27/2025
0.6.0.2-alpha 192 8/27/2025
0.6.0.1-alpha 191 8/27/2025
0.6.0-alpha 282 8/25/2025
0.5.2-alpha 130 8/17/2025
0.5.1-alpha 149 8/14/2025
0.5.0-alpha 153 8/12/2025
0.4.1-alpha 115 8/9/2025
0.4.0-alpha 227 8/5/2025
0.3.0-alpha 45 8/2/2025
0.2.2-alpha 114 8/1/2025
0.2.1-alpha 126 7/30/2025
0.2.0-alpha 127 7/27/2025