Assimalign.Extensions.Mapping 1.0.0-pre.1.0

Prefix Reserved
This is a prerelease version of Assimalign.Extensions.Mapping.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Assimalign.Extensions.Mapping --version 1.0.0-pre.1.0                
NuGet\Install-Package Assimalign.Extensions.Mapping -Version 1.0.0-pre.1.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="Assimalign.Extensions.Mapping" Version="1.0.0-pre.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Assimalign.Extensions.Mapping --version 1.0.0-pre.1.0                
#r "nuget: Assimalign.Extensions.Mapping, 1.0.0-pre.1.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 Assimalign.Extensions.Mapping as a Cake Addin
#addin nuget:?package=Assimalign.Extensions.Mapping&version=1.0.0-pre.1.0&prerelease

// Install Assimalign.Extensions.Mapping as a Cake Tool
#tool nuget:?package=Assimalign.Extensions.Mapping&version=1.0.0-pre.1.0&prerelease                

Component Model Mapping

A light weight object mapper.

Examples

1. Create Nested Object Map

2. Map Multiple Sources to a Single Target

Create multiple profiles

public class Person
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public int Age { get; set; }
}
public class Person1
{
    public string FirstName { get; set; }
    public string LastName { get; set; }   
}
public class Person2
{
    public string Name { get; set; }
    public int Age { get; set; }
}

public class PersonProfile1 : MapperProfile<Person, Person1>
{
    public override void Configure(IMapperActionDescriptor<Person, Person1> descriptor) 
    {
        descriptor
            .MapMember(target => target.FirstName, source => source.FirstName)
            .MapMember(target => target.LastName, source => source.LastName);
    }
}

public class PersonProfile2 : MapperProfile<Person, Person2>
{
    public override void Configure(IMapperActionDescriptor<Person, Person2> descriptor) 
    {
        descriptor.MapMember(target => target.Age, source => source.Age);
    }
}

public static void Main()
{
    var mapper = Mapper.Create(builder =>
    {
        builder.AddOptions(configure =>
        {
            
        });
        builder.AddProfile(new PersonProfile1());
        builder.AddProfile(new PersonProfile2());
    });

    var p1 = new Person1() { FirstName = "John", LastName = "Doe" };
    var p2 = new Person2() { Age = 30};

    var person = mapper.Map<Person>(p1, p2);
}

Product 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Assimalign.Extensions.Mapping:

Package Downloads
Assimalign.Azure.WebJobs.Extensions.Mapping

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-pre.1.0.4 158 6/16/2022
1.0.0-pre.1.0.3 139 5/23/2022
1.0.0-pre.1.0 116 5/23/2022