HcfNS.AutoMapper
7.0.2.2
dotnet add package HcfNS.AutoMapper --version 7.0.2.2
NuGet\Install-Package HcfNS.AutoMapper -Version 7.0.2.2
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="HcfNS.AutoMapper" Version="7.0.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HcfNS.AutoMapper --version 7.0.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HcfNS.AutoMapper, 7.0.2.2"
#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 HcfNS.AutoMapper as a Cake Addin #addin nuget:?package=HcfNS.AutoMapper&version=7.0.2.2 // Install HcfNS.AutoMapper as a Cake Tool #tool nuget:?package=HcfNS.AutoMapper&version=7.0.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Hcf AutoMapper 对象映射组件,封装基于AutoMapper的对象映射实现
用法
添加AutoMapper组件包
services.AddPack<AutoMapperPack>();
示例
克隆对象
using Hcf.AutoMapper;
using Hcf.Mapping;
TestInfo testInfo1 = new TestInfo()
{
Id = 1,
Name = Guid.NewGuid().ToString(),
CreatedTime=DateTime.Now
};
var testInfo2 = testInfo1.MapTo<TestInfo>();
对象动态赋值
创建一个Dto类,标记可以从TestInfo类型映射
/// <summary>
/// TestOutputDto
/// </summary>
[MapFrom(typeof(TestInfo))]
public class TestOutputDto
{
/// <summary>
/// Id
/// </summary>
public int Id { set; get; }
/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }
}
将testInfo1对象的值赋值给该Dto对象
var testInfo3 = testInfo1.MapTo<TestOutputDto>();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 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 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- AutoMapper (>= 13.0.1)
- HcfNS.Core (>= 7.0.2.1)
-
net7.0
- AutoMapper (>= 13.0.1)
- HcfNS.Core (>= 7.0.2.1)
-
net8.0
- AutoMapper (>= 13.0.1)
- HcfNS.Core (>= 7.0.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
7.0.2.2 | 77 | 12/28/2024 |
7.0.2.1 | 93 | 12/23/2024 |
7.0.2 | 84 | 12/19/2024 |
7.0.1 | 94 | 11/22/2024 |
7.0.0 | 96 | 11/1/2024 |
6.0.12.1 | 137 | 9/4/2024 |
6.0.12 | 100 | 9/4/2024 |
6.0.11 | 109 | 9/4/2024 |
6.0.10 | 67 | 7/30/2024 |
6.0.9 | 73 | 7/30/2024 |
6.0.8.1 | 105 | 6/7/2024 |
6.0.8 | 119 | 4/28/2024 |
6.0.7 | 207 | 3/8/2024 |
6.0.6 | 451 | 12/27/2023 |
6.0.5.2 | 486 | 12/1/2023 |
6.0.5.1 | 467 | 11/14/2023 |
6.0.5 | 457 | 11/13/2023 |
6.0.4.1 | 477 | 11/3/2023 |
6.0.4 | 457 | 11/3/2023 |
6.0.3 | 453 | 10/31/2023 |
6.0.2 | 675 | 6/26/2023 |
6.0.1 | 912 | 10/18/2022 |
6.0.0.1 | 937 | 10/10/2022 |
6.0.0 | 924 | 8/17/2022 |
5.1.1 | 990 | 3/16/2022 |
5.0.1.6 | 866 | 8/5/2021 |
5.0.1.5 | 822 | 8/3/2021 |
5.0.1.4 | 876 | 8/2/2021 |
5.0.1.3 | 837 | 7/27/2021 |
5.0.1.2 | 962 | 6/27/2021 |
5.0.1.1 | 923 | 6/27/2021 |
5.0.1 | 829 | 6/19/2021 |
5.0.0 | 828 | 6/19/2021 |
3.3.11.1 | 900 | 3/2/2021 |
3.3.11 | 938 | 2/26/2021 |
3.3.10 | 938 | 2/24/2021 |
3.3.9 | 906 | 2/22/2021 |
3.3.8 | 942 | 12/17/2020 |
3.3.7.1 | 942 | 12/16/2020 |
3.3.7 | 1,025 | 12/12/2020 |
3.3.6 | 914 | 12/1/2020 |
3.3.5 | 921 | 12/1/2020 |
3.3.4.2 | 924 | 11/20/2020 |
3.3.4.1 | 1,008 | 11/19/2020 |
3.3.4 | 1,060 | 11/11/2020 |
3.3.3.1 | 995 | 10/20/2020 |
3.3.3 | 976 | 10/19/2020 |
3.3.2.2 | 952 | 10/9/2020 |
3.3.2.1 | 1,017 | 9/30/2020 |
3.3.2 | 1,003 | 9/30/2020 |
3.3.1 | 1,013 | 9/26/2020 |
3.3.0 | 1,025 | 9/3/2020 |
3.2.10.1 | 1,035 | 8/20/2020 |
3.2.10 | 1,018 | 8/10/2020 |
3.2.9.2 | 1,004 | 7/29/2020 |
3.2.9.1 | 1,056 | 7/29/2020 |
3.2.8.3 | 1,184 | 7/14/2020 |
3.2.8.2 | 1,160 | 7/14/2020 |
3.2.7.2 | 1,206 | 7/13/2020 |
3.2.7 | 1,369 | 7/12/2020 |
3.2.6 | 1,363 | 7/9/2020 |
3.2.4.1 | 1,455 | 6/20/2020 |
3.2.4 | 1,157 | 6/20/2020 |
3.2.3 | 1,511 | 6/20/2020 |
3.2.2 | 1,183 | 6/15/2020 |
3.2.1 | 1,064 | 6/12/2020 |
3.2.0.1 | 1,733 | 6/12/2020 |
3.2.0 | 1,657 | 6/9/2020 |
3.0.1 | 3,424 | 4/30/2020 |
3.0.0 | 1,707 | 4/26/2020 |