private object MapCore(object source, Type sourceType, Type destinationType, MappingOperationOptions options) { var typeMap = ConfigurationProvider.ResolveTypeMap(source, null, sourceType, destinationType); var context = new ResolutionContext(typeMap, source, sourceType, destinationType, options, this); return(((IMappingEngineRunner)this).Map(context)); }
public object Map(object source, Type sourceType, Type destinationType, Action <IMappingOperationOptions> opts) { var options = new MappingOperationOptions(); opts(options); return(MapCore(source, sourceType, destinationType, options)); }
public ResolutionContext(TypeMap typeMap, object source, object destination, Type sourceType, Type destinationType, MappingOperationOptions options, IMappingEngine engine) : this(Empty, source, destination, sourceType, destinationType, typeMap) { InstanceCache = new Dictionary <ResolutionContext, object>(); Options = options; Engine = engine; }
public TDestination Map <TSource, TDestination>(TSource source, TDestination destination, Action <IMappingOperationOptions <TSource, TDestination> > opts) { var modelType = typeof(TSource); var destinationType = typeof(TDestination); var options = new MappingOperationOptions <TSource, TDestination>(); opts(options); return((TDestination)MapCore(source, destination, modelType, destinationType, options)); }
public ResolutionContext(TypeMap typeMap, object source, Type sourceType, Type destinationType, MappingOperationOptions options, IMappingEngine engine) : this(typeMap, source, null, sourceType, destinationType, options, engine) { }