Beispiel #1
0
        internal DynamicProjection(DynamicProjectionConfiguration configuration)
        {
            this.configuration = configuration;
            compiler           = new DynamicProjectionCompiler(configuration);

            CompiledConfiguration = compiler.GetCompiledConfiguration();
        }
 public CompiledDynamicProjectionConfiguration(
     DynamicProjectionConfiguration configuration,
     List <CompiledCtorParamTargetConfiguration> compiledCtorParams,
     List <CompiledMemberTargetConfiguration> compiledMembers,
     List <MemberInitAssignment> memberInitAssignments,
     List <CtorParameterAssignment> ctorParameterAssignments,
     LambdaExpression defaultSelector
     )
 {
     SourceType               = configuration.SourceType;
     ProjectedType            = configuration.ProjectedType;
     It                       = configuration.It;
     Members                  = configuration.Members;
     CtorParameters           = configuration.CtorParameters;
     MemberNameMatchStrategy  = configuration.MemberNameMatchStrategy;
     Ctor                     = configuration.Ctor;
     CompiledCtorParams       = compiledCtorParams.ToDictionary(x => x.CtorParameter.ParameterInfo.Name);
     CompiledMembers          = compiledMembers.ToDictionary(x => x.Member.MemberInfo.Name);
     MemberInitAssignments    = memberInitAssignments;
     CtorParameterAssignments = ctorParameterAssignments;
     DefaultSelector          = defaultSelector;
 }
Beispiel #3
0
 public DynamicProjectionCompiler(DynamicProjectionConfiguration configuration)
 {
     this.configuration        = configuration;
     compiledConfigurationLazy = new Lazy <CompiledDynamicProjectionConfiguration>(Compile);
 }
        //public IMemberNameMatchStrategy MemberNameMatchStrategy { get; internal set; } = new DefaultMemberNameMatchStrategy();

        //internal readonly List<MemberTargetConfiguration> members = new List<MemberTargetConfiguration>();
        //internal readonly List<CtorParamTargetConfiguration> ctorParameters = new List<CtorParamTargetConfiguration>();

        protected ProjectionBuilderBase(Type sourceType, Type projectedType)
        {
            Configuration = new DynamicProjectionConfiguration(sourceType, projectedType);
            //SourceType = sourceType;
            //ProjectedType = projectedType;
        }