Ejemplo n.º 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,
            });
        }
Ejemplo n.º 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
            });
        }
Ejemplo n.º 3
0
 internal ExpressionMemberTargetBuilder(MemberTargetConfiguration configuration)
     : base(configuration)
 {
 }
Ejemplo n.º 4
0
 internal ConfiguredMemberTargetBuilder(MemberTargetConfiguration configuration)
 {
     Configuration = configuration;
 }
Ejemplo n.º 5
0
 internal MemberTargetBuilder(MemberTargetConfiguration configuration)
 {
     this.configuration = configuration;
 }
Ejemplo n.º 6
0
 internal ConstantMemberTargetBuilder(MemberTargetConfiguration configuration)
     : base(configuration)
 {
 }
Ejemplo n.º 7
0
        //TODO: Using specific Ctor

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