Exemplo n.º 1
0
        public object Map(Type type, XElement element, IMappingStrategy strategy = null)
        {
            var instance = _typeFactory.InstanceOf(type);
            // since the type param might be an interface, and we need the concrete type
            var concreteType = instance.GetType();

            strategy = strategy ?? _strategyManager.GetStrategyFor(type);
            var mapping = _mappingFactory.CreateMapping(concreteType, element, strategy);

            mapping.Apply(instance);
            return(instance);
        }