AddAliases() public method

public AddAliases ( IEnumerable aliasesToAdd ) : void
aliasesToAdd IEnumerable
return void
Ejemplo n.º 1
0
        private ODataExpression(ODataSessionFactoryContext sessionFactoryContext, System.Type persistentClass, ODataParserConfiguration configuration)
        {
            Require.NotNull(sessionFactoryContext, "sessionFactoryContext");
            Require.NotNull(persistentClass, "persistentClass");
            Require.NotNull(configuration, "configuration");

            _persistentClass = persistentClass;
            _configuration   = configuration;

            _context = new CriterionBuildContext(
                sessionFactoryContext,
                configuration.CaseSensitive,
                configuration.CaseSensitiveLike,
                configuration.NameResolver ?? new NameResolver()
                );
            _context.AliasesByName.Add(RootAlias, new Alias(RootAlias, string.Empty, _persistentClass));

            if (persistentClass != null)
            {
                _context.PushLambdaContext("$it", _persistentClass, RootAlias);
            }

            _normalizeVisitor = new AliasingNormalizeVisitor(_context, persistentClass, RootAlias);
            _context.AddAliases(_normalizeVisitor.Aliases.Values);
        }
Ejemplo n.º 2
0
        private ODataExpression(ODataSessionFactoryContext sessionFactoryContext, System.Type persistentClass, ODataParserConfiguration configuration)
        {
            Require.NotNull(sessionFactoryContext, "sessionFactoryContext");
            Require.NotNull(persistentClass, "persistentClass");
            Require.NotNull(configuration, "configuration");

            _persistentClass = persistentClass;
            _configuration = configuration;

            _context = new CriterionBuildContext(
                sessionFactoryContext,
                configuration.CaseSensitive,
                configuration.CaseSensitiveLike,
                configuration.NameResolver ?? new NameResolver()
            );
            _context.AliasesByName.Add(RootAlias, new Alias(RootAlias, string.Empty, _persistentClass));

            if (persistentClass != null)
                _context.PushLambdaContext("$it", _persistentClass, RootAlias);
            
            _normalizeVisitor = new AliasingNormalizeVisitor(_context, persistentClass, RootAlias);
            _context.AddAliases(_normalizeVisitor.Aliases.Values);
        }