Exemplo n.º 1
0
        private IPropBagMapperBuilder <TSource, TDestination> BuildTheAutoMapperBuilder <TSource, TDestination>()
            where TDestination : class, IPropBag
        {
            // Create a MapperBuilder for this request.
            IPropBagMapperBuilder <TSource, TDestination> propBagMapperBuilder
                = _mapperBuilderProvider.GetPropBagMapperBuilder <TSource, TDestination>(this);

            return(propBagMapperBuilder);
        }
Exemplo n.º 2
0
        // Typed Submit with Mapping Configuration.
        public IPropBagMapperRequestKey <TSource, TDestination> SubmitPropBagMapperRequest <TSource, TDestination>
        (
            PropModelType propModel,
            IConfigureAMapper <TSource, TDestination> mappingConfiguration,
            IHaveAMapperConfigurationStep configStarterForThisRequest,
            IPropFactory propFactory = null
        )
            where TDestination : class, IPropBag
        {
            // Use the AutoMapperService to register a 'raw' request.
            IAutoMapperRequestKey <TSource, TDestination> autoMapperRequestKey =
                this.SubmitRawAutoMapperRequest <TSource, TDestination>
                (
                    propModel,
                    mappingConfiguration,
                    configStarterForThisRequest
                );


            // Note: at this point we can fetch the Mapper Config Details.
            //IAutoMapperConfigDetails autoMapperConfigDetails = autoMapperRequestKey.AutoMapperConfigDetails;
            //IPropBagMapperConfigDetails propBagMapperConfigDetails = (IPropBagMapperConfigDetails)autoMapperConfigDetails;


            // Create a MapperBuilder for this request.
            IPropBagMapperBuilder <TSource, TDestination> propBagMapperBuilder
                = BuildTheAutoMapperBuilder <TSource, TDestination>(/*configStarterForThisRequest*/);

            // Create the PropBag Mapper Request.
            IPropBagMapperRequestKey <TSource, TDestination> propBagMapperRequestKey
                = new PropBagMapperRequestKey <TSource, TDestination>
                  (
                      propBagMapperBuilder,
                      autoMapperRequestKey // This contains a reference to the propModel.
                      //,
                      //propModel
                  );


            // Note: at this point we can fetch the Mapper Config Details from the PropBagMapperRequestKey.
            //IPropBagMapperConfigDetails propBagMapperConfigDetails = propBagMapperRequestKey.PropBagMapperConfigDetails;


            //// Store the request
            //IPropBagMapperKeyGen newMapRequest = RegisterPropBagMapperRequest(typedMapperRequest);
            //return (IPropBagMapperKey<TSource, TDestination>)newMapRequest;

            // We could store the request in the PropBagMapper Cache, but it would not be used.
            return(propBagMapperRequestKey);
        }
Exemplo n.º 3
0
        public PropBagMapperRequestKey
        (
            IPropBagMapperBuilder <TSource, TDestination> propBagMapperBuilder,
            IAutoMapperRequestKey <TSource, TDestination> autoMapperRequestKey
            //,
            //PropModelType propModel
        )
            : base
            (
                propBagMapperBuilder.PropBagMapperBuilderGen,
                autoMapperRequestKey
                //  ,
                //propModel
            )
        {
            _propBagMapperBuilder = propBagMapperBuilder;

            CheckTypes();
        }