コード例 #1
0
        public TDestination Map <TDestination>(object source)
        {
            var factory = new ResolverFactory(MapperContainer.Value);

            var       resolveType = source is IEnumerable ? ResolveType.Collection : ResolveType.Single;
            IResolver resolver    = factory.Create(resolveType);

            var destination = resolver.ResolveTypeMap(source);

            return((TDestination)destination);
        }
コード例 #2
0
            protected override void Populate(IProcess process, Parameters instance)
            {
                var parameters = (InsertPartParameters)instance;

                if (_resolver == null)
                {
                    _resolver = ResolverFactory.Create(Part);
                }

                parameters.Target = (IProductType)_resolver.Resolve(process);
            }
コード例 #3
0
            protected override ParametersBase ResolveBinding(IProcess process)
            {
                if (_resolver == null)
                {
                    _resolver = ResolverFactory.Create(Part);
                }

                return(new InsertPartParameters
                {
                    Target = (IProductType)_resolver.Resolve(process)
                });
            }
コード例 #4
0
 public void RegisterResolver() => ResolverFactory
 .Create()
 .Finally(resolver => _objectContainer
          .RegisterInstanceAs(resolver));