public override List <GroupDataItem> GroupInfoDataItems() { var groupQueryResult = DataQueryProvider .CreateQuery(LOG(GROUPQueryInfo.GROUPQuery)) .SetParameters(QueryPARAMETERS) .List(); var groupQueryDataSource = FIX_INSENSITIVE_COLLATION(groupQueryResult.Cast <object[]>().ToArray()); var groupDataItemFactory = new GroupDataItemFactory(GROUPQueryInfo.PropertyExpressions, GROUPQueryInfo.SummaryDescriptors); var result = groupQueryDataSource.Select(groupDataItemFactory.Produce).ToList(); if (GROUPQueryInfo.GROUPORDERQuery.IsNotEmpty()) { var groupOrderQueryResult = DataQueryProvider .CreateQuery(LOG(GROUPQueryInfo.GROUPORDERQuery)) .SetParameters(QueryPARAMETERS) .List() .ToArray(); var groupOrderQueryDataSource = FIX_INSENSITIVE_COLLATION(groupOrderQueryResult.Select(x => x as object[] ?? new[] { x }).ToArray()); var keysActualOrder = groupOrderQueryDataSource.Select(x => x.CalculateKey()).ToList(); result = result.OrderBy(keysActualOrder, x => x.Key).ToList(); } return(result); }
public override TResult[] Items(int firstResult, int maxResults) { return(ExecuteFetchingPostProcess( DataQueryProvider .CreateQuery(LOG(SELECTQuery)) .SetFirstResult(firstResult) .SetMaxResults(maxResults) .SetParameters(QueryPARAMETERS) .List <TSource>() ).ToArray()); }
public override SummaryRepository TotalSummaryRepository() { var queryResult = DataQueryProvider .CreateQuery(LOG(TOTALQueryInfo.TOTALQuery)) .SetParameters(QueryPARAMETERS) .List()[0]; var dataSource = queryResult as object[] ?? new[] { queryResult }; var summaryRepositoryItemFactory = new SummaryRepositoryItemFactory(dataSource); return(new SummaryRepository( TOTALQueryInfo.SummaryDescriptors.Select(summaryRepositoryItemFactory.Produce).ToList() )); }