Ejemplo n.º 1
0
        public JoinClauseVisitor(JoinClause joinClause, int index)
        {
            Index = index;

            JoinExpressionTreeVisitor from = new JoinExpressionTreeVisitor(joinClause.InnerKeySelector);

            HandleFrom(from);
            JoinExpressionTreeVisitor to = new JoinExpressionTreeVisitor(joinClause.OuterKeySelector);

            HandleTo(to);
        }
Ejemplo n.º 2
0
        private void HandleTo(JoinExpressionTreeVisitor to)
        {
            ModelMetadataRepository modelMetadataRepository = new ModelMetadataRepository();
            EntityModelType         entityModelType         = null;

            if (to.MemberContainingType != null)
            {
                entityModelType = modelMetadataRepository.GetModelMetadata(to.MemberContainingType);
            }

            if (entityModelType == null)
            {
                ToEntity    = to.EntityLogicalName;
                ToAttribute = to.MemberName;
            }
            else
            {
                ToEntity    = entityModelType.EntityLogicalName;
                ToAttribute = entityModelType.ParameterToAttributeLogicalName[to.MemberName];
            }
        }
Ejemplo n.º 3
0
        private void HandleFrom(JoinExpressionTreeVisitor from)
        {
            ModelMetadataRepository modelMetadataRepository = new ModelMetadataRepository();
            EntityModelType         entityModelType         = null;

            if (from.MemberContainingType != null)
            {
                entityModelType = modelMetadataRepository.GetModelMetadata(from.MemberContainingType);
            }

            if (entityModelType == null)
            {
                FromEntity    = from.EntityLogicalName;
                FromAttribute = from.MemberName;
            }
            else
            {
                FromEntity    = entityModelType.EntityLogicalName;
                FromAttribute = entityModelType.ParameterToAttributeLogicalName[from.MemberName];
            }
        }