This is is an intelligent, refactoring safe object mapping library that automatically maps objects to each other event when the property names are not exactly the same.
Features:
- Maps Simple Objects
- Complex Objects
- Exclude Properties
Steps To use ExIgniter.ObjectMapper
-
Install ExIgniter.ObjectMapper from Nuget
-
Sample code:
var testCustomer = new Customer() {
City = "Eko",
FirstName = "Suraj",
LastName = "Deji",
ID = 1,
Order = new Order() { Name = "Benz", Quantity = 1 }
};
var mappedObject = testCustomer.Map(new CustomerVm(), vm => new[] {
nameof(vm.PropertyA), nameof(vm.PropertyB)
}
);
- Enjoy