Use this tag for version specific questions about AutoMapper 2 - the convention-based object-to-object mapper and transformer library for .NET. When using this tag also include the more generic [automapper] tag where possible.
I swear I've done it before, but I can't seem to get it to work now. Basically I'm getting an EndUser containing a Site, and I want to map that Site to a SiteInfo object.
Here's my map configuration:
Mapper.CreateMap()
…
I have an XML file that defines a map for an object -- it basically tells me to map:
A -> _a
B -> _b
C -> SomeFunction(_d)
I'd like to parse this at runtime (easy enough) and then somehow initialize an automapper map for this.. I've tried a few…
I am having a strange issue with AutoMapper.
If I do the following
//Get my entities from EF repository
var movements = _movementRepository.AllIncluding(movement => movement.Asset, movement => movement.Job,movement =>…
I am using Automapper for mapping two objects.
I have field VehicleModel in the destination which has some default value. I don't have a mapping for this destination field in the source. So I didn't map it. After mapping is done, my default value is…
I have an ASP.NET MVC application that uses Fluent NHibernate and AutoMapper.
I am primarily using AutoMapper to map my Models to ViewModels and vice versa.
When doing the latter, mapping from my viewmodel back to a model, I am wondering how I can…
I am able to map group of sametype of collections to a single collection using the below code.
AutoMapper.Mapper.CreateMap().ForMember(
dest => dest.Drivers,
opt => opt.MapFrom(src =>…
I have my classes defined as below
Source {
public List UnreportedDrivers { get; set; } // count 1
public List LendingLossDrivers { get; set; } // count 2
public List OtherDrivers { get; set; } // count…
I'm using an automapper to flatten the object coming from WS. Simplified model would be as follows:
public abstract class AOrder {
public Product Product {get;set;}
public decimal Amount {get;set;}
//number of other properties
}
public…