Пример #1
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);
        }
Пример #2
0
 public bool Equals(PropBagMapperRequestKey <TSource, TDestination> other)
 {
     return(((IPropBagMapperRequestKey <TSource, TDestination>) this).Equals(other));
 }