Boxed.Mapping
7.0.0
.NET 6.0
.NET Standard 1.3
This package has a SemVer 2.0.0 package version: 7.0.0+build.1058.
dotnet add package Boxed.Mapping --version 7.0.0
NuGet\Install-Package Boxed.Mapping -Version 7.0.0
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="Boxed.Mapping" Version="7.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Boxed.Mapping --version 7.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Boxed.Mapping, 7.0.0"
#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 Boxed.Mapping as a Cake Addin
#addin nuget:?package=Boxed.Mapping&version=7.0.0
// Install Boxed.Mapping as a Cake Tool
#tool nuget:?package=Boxed.Mapping&version=7.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Boxed.Mapping
A simple and fast (fastest?) object to object mapper that does not use reflection. Read A Simple and Fast Object Mapper for more information.
public class MapFrom
{
public bool BooleanFrom { get; set; }
public int IntegerFrom { get; set; }
public List<MapFromChild> ChildrenFrom { get; set; }
}
public class MapFromChild
{
public DateTimeOffset DateTimeOffsetFrom { get; set; }
public string StringFrom { get; set; }
}
public class MapTo
{
public bool BooleanTo { get; set; }
public int IntegerTo { get; set; }
public List<MapToChild> ChildrenTo { get; set; }
}
public class MapToChild
{
public DateTimeOffset DateTimeOffsetTo { get; set; }
public string StringTo { get; set; }
}
public class DemoMapper : IMapper<MapFrom, MapTo>
{
private readonly IMapper<MapFromChild, MapToChild> childMapper;
public DemoMapper(IMapper<MapFromChild, MapToChild> childMapper) => this.childMapper = childMapper;
public void Map(MapFrom source, MapTo destination)
{
destination.BooleanTo = source.BooleanFrom;
destination.IntegerTo = source.IntegerFrom;
destination.ChildrenTo = childMapper.MapList(source.ChildrenFrom);
}
}
public class DemoChildMapper : IMapper<MapFromChild, MapToChild>
{
public void Map(MapFromChild source, MapToChild destination)
{
destination.DateTimeOffsetTo = source.DateTimeOffsetFrom;
destination.StringTo = source.StringFrom;
}
}
public class UsageExample
{
private readonly IMapper<MapFrom, MapTo> mapper = new DemoMapper();
public MapTo MapOneObject(MapFrom source) => this.mapper.Map(source);
public MapTo[] MapArray(List<MapFrom> source) => this.mapper.MapArray(source);
public List<MapTo> MapList(List<MapFrom> source) => this.mapper.MapList(source);
public IAsyncEnumerable<MapTo> MapAsyncEnumerable(IAsyncEnumerable<MapFrom> source) =>
this.mapper.MapEnumerableAsync(source);
}
Also includes IImmutableMapper<TSource, TDestination>
which is for mapping to immutable types like C# 9 record
's and can also be used for enum
types.
public record MapFrom(bool BooleanFrom, int IntegerFrom);
public record MapTo(bool BooleanTo, int IntegerTo);
public class DemoImmutableMapper : IImmutableMapper<MapFrom, MapTo>
{
public MapTo Map(MapFrom source) =>
new MapTo(source.BooleanFrom, source.IntegerFrom);
}
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 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. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 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)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Boxed.Mapping:
Package | Downloads |
---|---|
WebScheduler.Client.Core
The core client library for the WebScheduler server. |
|
Uponey.Core.Contract
Package Description |
|
Kasp.ObjectMapper.Benchmark
Package Description |
|
PikTools.Modules.Pylons.Shared
PikTools core library for Modules Pylons |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Boxed.Mapping:
Repository | Stars |
---|---|
Dotnet-Boxed/Templates
.NET project templates with batteries included, providing the minimum amount of code required to get you going faster.
|
Version | Downloads | Last updated |
---|---|---|
7.0.0 | 774 | 9/14/2023 |
6.0.0 | 130,090 | 11/9/2021 |
5.3.0 | 77,568 | 3/11/2021 |
5.2.0 | 24,669 | 12/3/2020 |
5.1.0 | 3,389 | 11/23/2020 |
5.0.0 | 31,164 | 7/20/2020 |
4.0.0 | 56,595 | 3/17/2020 |
3.0.0 | 19,324 | 11/30/2019 |
2.0.0 | 7,052 | 9/13/2019 |
1.4.0 | 10,947 | 7/14/2019 |
1.3.0 | 27,599 | 12/27/2018 |
1.2.0 | 34,734 | 7/13/2018 |
1.1.0 | 2,468 | 5/25/2018 |
1.0.0 | 2,697 | 5/6/2018 |