public ODataExpression(ODataSessionFactoryContext context, string queryString, System.Type persistentClass, ODataParserConfiguration configuration) : this(context, persistentClass, configuration) { Require.NotNull(queryString, "queryString"); ParseQueryString(queryString); }
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); }
public ODataExpression(ODataSessionFactoryContext context, IEnumerable<KeyValuePair<string, string>> queryStringParts, System.Type persistentClass, ODataParserConfiguration configuration) : this(context, persistentClass, configuration) { Require.NotNull(queryStringParts, "queryStringParts"); foreach (var part in queryStringParts) ProcessQueryStringPart(part.Key, part.Value); }
public ODataExpression(string queryString, System.Type persistentClass, ODataParserConfiguration configuration) { Require.NotNull(queryString, "queryString"); Require.NotNull(persistentClass, "persistentClass"); Require.NotNull(configuration, "configuration"); _normalizeVisitor = new AliasingNormalizeVisitor(persistentClass, configuration.CaseSensitive); ParseQueryString(queryString); }
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); }
public ODataExpression(ODataSessionFactoryContext context, IEnumerable <KeyValuePair <string, string> > queryStringParts, System.Type persistentClass, ODataParserConfiguration configuration) : this(context, persistentClass, configuration) { Require.NotNull(queryStringParts, "queryStringParts"); foreach (var part in queryStringParts) { ProcessQueryStringPart(part.Key, part.Value); } }
public ODataExpression(ODataSessionFactoryContext context, string queryString, System.Type persistentClass, ODataParserConfiguration configuration) : this(context, persistentClass, configuration) { Require.NotNull(queryString, "queryString"); ParseQueryString(queryString); }
/// <summary> /// Builds an ICriteria for an already parsed query string. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="entityName">Name of the entity to query.</param> /// <param name="queryStringParts">Unescaped query string parts.</param> /// <param name="configuration">Extra configuration.</param> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public static ICriteria ODataQuery(this ISession session, string entityName, IEnumerable <KeyValuePair <string, string> > queryStringParts, ODataParserConfiguration configuration) { Require.NotNull(session, "session"); Require.NotNull(entityName, "entityName"); Require.NotNull(queryStringParts, "queryStringParts"); return(_context.ODataQuery(session, entityName, queryStringParts, configuration)); }
/// <summary> /// Parses an OData query string and builds an ICriteria for it. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="entityName">Name of the entity to query.</param> /// <param name="queryString">OData query string.</param> /// <param name="configuration">Extra configuration.</param> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public static ICriteria ODataQuery(this ISession session, string entityName, string queryString, ODataParserConfiguration configuration) { Require.NotNull(session, "session"); Require.NotNull(entityName, "entityName"); Require.NotNull(queryString, "queryString"); return(_context.ODataQuery(session, entityName, queryString, configuration)); }
/// <summary> /// Builds an ICriteria for an already parsed query string. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="queryStringParts">Unescaped query string parts.</param> /// <param name="configuration">Extra configuration.</param> /// <typeparam name="T">Type of the entity to query.</typeparam> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public static ICriteria ODataQuery <T>(this ISession session, IEnumerable <KeyValuePair <string, string> > queryStringParts, ODataParserConfiguration configuration) { return(_context.ODataQuery(session, typeof(T), queryStringParts, configuration)); }
/// <summary> /// Parses an OData query string and builds an ICriteria for it. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="queryString">OData query string.</param> /// <param name="configuration">Extra configuration.</param> /// <typeparam name="T">Type of the entity to query.</typeparam> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public static ICriteria ODataQuery <T>(this ISession session, string queryString, ODataParserConfiguration configuration) { return(_context.ODataQuery(session, typeof(T), queryString, configuration)); }
/// <summary> /// Builds an ICriteria for an already parsed query string. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="persistentClass">Type of the entity to query.</param> /// <param name="queryStringParts">Unescaped query string parts.</param> /// <param name="configuration">Extra configuration.</param> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public static ICriteria ODataQuery(this ISession session, System.Type persistentClass, IEnumerable <KeyValuePair <string, string> > queryStringParts, ODataParserConfiguration configuration) { Require.NotNull(session, "session"); Require.NotNull(persistentClass, "persistentClass"); Require.NotNull(queryStringParts, "queryStringParts"); return(_context.ODataQuery(session, persistentClass, queryStringParts, configuration)); }
/// <summary> /// Parses an OData query string and builds an ICriteria for it. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="persistentClass">Type of the entity to query.</param> /// <param name="queryString">OData query string.</param> /// <param name="configuration">Extra configuration.</param> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public static ICriteria ODataQuery(this ISession session, System.Type persistentClass, string queryString, ODataParserConfiguration configuration) { Require.NotNull(session, "session"); Require.NotNull(persistentClass, "persistentClass"); Require.NotNull(queryString, "queryString"); return(_context.ODataQuery(session, persistentClass, queryString, configuration)); }
/// <summary> /// Builds an ICriteria for an already parsed query string. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="entityName">Name of the entity to query.</param> /// <param name="queryStringParts">Unescaped query string parts.</param> /// <param name="configuration">Extra configuration.</param> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public ICriteria ODataQuery(ISession session, string entityName, IEnumerable <KeyValuePair <string, string> > queryStringParts, ODataParserConfiguration configuration) { Require.NotNull(session, "session"); Require.NotNull(entityName, "entityName"); Require.NotNull(queryStringParts, "queryStringParts"); var persistenceClass = ResolvePersistenceClass(session, entityName); var expression = new ODataExpression(GetSessionFactoryContext(session.SessionFactory), queryStringParts, persistenceClass, configuration ?? new ODataParserConfiguration()); return(expression.BuildCriteria(session, persistenceClass)); }
/// <summary> /// Builds an ICriteria for an already parsed query string. /// </summary> /// <param name="session">NHibernate session to build the /// ICriteria for.</param> /// <param name="persistentClass">Type of the entity to query.</param> /// <param name="queryStringParts">Unescaped query string parts.</param> /// <param name="configuration">Extra configuration.</param> /// <returns>An <see cref="ICriteria"/> based on the provided /// query string.</returns> public ICriteria ODataQuery(ISession session, System.Type persistentClass, IEnumerable <KeyValuePair <string, string> > queryStringParts, ODataParserConfiguration configuration) { Require.NotNull(session, "session"); Require.NotNull(persistentClass, "persistentClass"); Require.NotNull(queryStringParts, "queryStringParts"); var expression = new ODataExpression(GetSessionFactoryContext(session.SessionFactory), queryStringParts, persistentClass, configuration ?? new ODataParserConfiguration()); return(expression.BuildCriteria(session, persistentClass)); }