Пример #1
0
        public SqlWriterResult GenerateCountSql <TBase, TProjection>(ProjectedSelectQuery <TBase, TProjection> projectedSelectQuery)
            where TBase : class, new()
        {
            // get fetch tree structure
            var rootNode = this.fetchTreeParser.GetFetchTree(projectedSelectQuery.BaseSelectQuery, out _, out var numberCollectionFetches) ?? new FetchNode();

            // add in the projection structure
            var selectProjectionParser = new SelectProjectionParser <TBase>(this.Configuration);

            selectProjectionParser.ParseExpression(projectedSelectQuery.ProjectionExpression, rootNode);

            return(this.InnerGenerateCountSql(projectedSelectQuery.BaseSelectQuery, rootNode, numberCollectionFetches));
        }
Пример #2
0
        public SelectWriterResult GenerateSql <TBase, TProjection>(ProjectedSelectQuery <TBase, TProjection> projectedSelectQuery)
            where TBase : class, new()
        {
            // get fetch tree structure
            var rootNode = this.fetchTreeParser.GetFetchTree(projectedSelectQuery.BaseSelectQuery, out _, out var numberCollectionFetches) ?? new FetchNode();

            // add in the projection struction
            var selectProjectionParser = new SelectProjectionParser <TBase>(this.Configuration);

            selectProjectionParser.ParseExpression(projectedSelectQuery.ProjectionExpression, rootNode);

            return(this.InnerGenerateSql(projectedSelectQuery.BaseSelectQuery, new AutoNamingDynamicParameters(), false, rootNode, numberCollectionFetches, new StringBuilder(), true));
        }