Example #1
0
        private CompiledMemberTargetConfiguration.CompiledSourceConfiguration CompileMemberSource(
            CompiledMemberTargetConfiguration.CompiledMemberConfiguration member, MemberTargetConfiguration memberConfiguration)
        {
            var source           = memberConfiguration.Source ?? new StringProjectionSource(GetSourceMemberNameFromMemberName(member.MemberInfo.Name));
            var sourceExpression = GetExpression(source, configuration.It);

            return(new CompiledMemberTargetConfiguration.CompiledSourceConfiguration()
            {
                SourceExpression = sourceExpression,
                Source = source,
                SourceKey = memberConfiguration.SourceKey,
                ValueMap = memberConfiguration.ValueMap,
            });
        }
Example #2
0
        private CompiledMemberTargetConfiguration.CompiledMemberConfiguration CompileMember(MemberTargetConfiguration memberConfiguration)
        {
            var memberInfo = GetMemberInfo(configuration.SourceType, configuration.ProjectedType, memberConfiguration.ProjectedMember);

            var parameter =
                memberConfiguration.ProjectionTarget == ProjectionTarget.CtorParameter ?
                memberConfiguration.CtorParameterName.IsNullOrEmpty() ?
                GetCtorParameterFromMemberName(memberInfo.Name) :
                GetCtorParameter(memberConfiguration.CtorParameterName) :
                null;

            if (memberConfiguration.ValueMap != null)
            {
                //var reverse = configuration.ValueMap.Values.ToLookup(x => x.Value, x => x.Key);
            }
            //apply valuemap

            return(new CompiledMemberTargetConfiguration.CompiledMemberConfiguration()
            {
                MemberInfo = memberInfo,
                MemberType = GetMemberInfoType(memberInfo),
                CtorParameterName = parameter?.Name,
                CtorParameterType = parameter?.ParameterType,
                ProjectionTarget = memberConfiguration.ProjectionTarget
            });
        }
Example #3
0
 internal ExpressionMemberTargetBuilder(MemberTargetConfiguration configuration)
     : base(configuration)
 {
 }
Example #4
0
 internal ConfiguredMemberTargetBuilder(MemberTargetConfiguration configuration)
 {
     Configuration = configuration;
 }
Example #5
0
 internal MemberTargetBuilder(MemberTargetConfiguration configuration)
 {
     this.configuration = configuration;
 }
Example #6
0
 internal ConstantMemberTargetBuilder(MemberTargetConfiguration configuration)
     : base(configuration)
 {
 }
Example #7
0
        //TODO: Using specific Ctor

        internal TMemberTargetBuilder GetMemberTargetBuilder(MemberTargetConfiguration configuration)
        => (TMemberTargetBuilder)memberTargetBuilderCtor.Invoke(configuration);