Getting Started

Powerful convention-based, customizable and fastest tool for object-object mapping.It is useful for Entity to DTO, DTO to Entity mapping strategies.

The latest builds can be found at NuGet

Sample

Test Classes:

public class Customer
{
    public int Id { get; set; }
    public string Name { get; set; }
    public decimal? Credit { get; set; }
    public DateTime CreateDate { get; set; }
}

public class CustomerDTO
{
    public int Id { get; set; }
    public string Name { get; set; }
    public decimal? Credit { get; set; }
}


Test Data

public Customer GetCustomer()
{
    Customer customer = new Customer()
    {
       Id = 1,
       Name = "Timucin Kivanc",
       Credit = 234.7m,
       CreateDate = DateTime.Now
    };

    return customer;
}


Map:

var customerDto = TypeAdapter.Adapt<Customer, CustomerDTO>(GetCustomer());

// result:
// customerDto.Id == 1
// customerDto.Name == "Timucin Kivanc"
// customerDto.Credit == 234.7m


Last edited Mar 28, 2014 at 11:06 AM by timucinkivanc, version 5