From 8175dc5f3da4078cd4f768958eb4f747b0afc563 Mon Sep 17 00:00:00 2001 From: David Lebee Date: Tue, 2 Feb 2021 15:05:32 -0500 Subject: [PATCH] will think about it again better. --- .../IAggregatableQuery.cs | 10 --- .../IFilterableQuery.cs | 12 ---- .../IGroupableQuery.cs | 10 --- .../IPageableQuery.cs | 11 --- .../ISortableQuery.cs | 10 --- ...weredSoft.AdvanceQuery.Abstractions.csproj | 11 --- .../AdvanceQueryHandlerBase.cs | 68 ------------------- .../PoweredSoft.CQRS.AdvanceQuery.csproj | 15 ---- PoweredSoft.CQRS.sln | 12 ---- 9 files changed, 159 deletions(-) delete mode 100644 PoweredSoft.AdvanceQuery.Abstractions/IAggregatableQuery.cs delete mode 100644 PoweredSoft.AdvanceQuery.Abstractions/IFilterableQuery.cs delete mode 100644 PoweredSoft.AdvanceQuery.Abstractions/IGroupableQuery.cs delete mode 100644 PoweredSoft.AdvanceQuery.Abstractions/IPageableQuery.cs delete mode 100644 PoweredSoft.AdvanceQuery.Abstractions/ISortableQuery.cs delete mode 100644 PoweredSoft.AdvanceQuery.Abstractions/PoweredSoft.AdvanceQuery.Abstractions.csproj delete mode 100644 PoweredSoft.CQRS.AdvanceQuery/AdvanceQueryHandlerBase.cs delete mode 100644 PoweredSoft.CQRS.AdvanceQuery/PoweredSoft.CQRS.AdvanceQuery.csproj diff --git a/PoweredSoft.AdvanceQuery.Abstractions/IAggregatableQuery.cs b/PoweredSoft.AdvanceQuery.Abstractions/IAggregatableQuery.cs deleted file mode 100644 index 4060e34..0000000 --- a/PoweredSoft.AdvanceQuery.Abstractions/IAggregatableQuery.cs +++ /dev/null @@ -1,10 +0,0 @@ -using PoweredSoft.DynamicQuery.Core; -using System.Collections.Generic; - -namespace PoweredSoft.AdvanceQuery.Abstractions -{ - public interface IAggregatableQuery - { - List GetAggregates(); - } -} diff --git a/PoweredSoft.AdvanceQuery.Abstractions/IFilterableQuery.cs b/PoweredSoft.AdvanceQuery.Abstractions/IFilterableQuery.cs deleted file mode 100644 index c4a8c69..0000000 --- a/PoweredSoft.AdvanceQuery.Abstractions/IFilterableQuery.cs +++ /dev/null @@ -1,12 +0,0 @@ -using PoweredSoft.DynamicQuery.Core; -using System; -using System.Collections.Generic; -using System.Text; - -namespace PoweredSoft.AdvanceQuery.Abstractions -{ - public interface IFilterableQuery - { - List GetFilters(); - } -} diff --git a/PoweredSoft.AdvanceQuery.Abstractions/IGroupableQuery.cs b/PoweredSoft.AdvanceQuery.Abstractions/IGroupableQuery.cs deleted file mode 100644 index 9f2fd74..0000000 --- a/PoweredSoft.AdvanceQuery.Abstractions/IGroupableQuery.cs +++ /dev/null @@ -1,10 +0,0 @@ -using PoweredSoft.DynamicQuery.Core; -using System.Collections.Generic; - -namespace PoweredSoft.AdvanceQuery.Abstractions -{ - public interface IGroupableQuery - { - List GetGroups(); - } -} diff --git a/PoweredSoft.AdvanceQuery.Abstractions/IPageableQuery.cs b/PoweredSoft.AdvanceQuery.Abstractions/IPageableQuery.cs deleted file mode 100644 index ea921bc..0000000 --- a/PoweredSoft.AdvanceQuery.Abstractions/IPageableQuery.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace PoweredSoft.AdvanceQuery.Abstractions -{ - - public interface IPageableQuery - { - int? GetPage(); - int? GetPageSize(); - } -} diff --git a/PoweredSoft.AdvanceQuery.Abstractions/ISortableQuery.cs b/PoweredSoft.AdvanceQuery.Abstractions/ISortableQuery.cs deleted file mode 100644 index a064d77..0000000 --- a/PoweredSoft.AdvanceQuery.Abstractions/ISortableQuery.cs +++ /dev/null @@ -1,10 +0,0 @@ -using PoweredSoft.DynamicQuery.Core; -using System.Collections.Generic; - -namespace PoweredSoft.AdvanceQuery.Abstractions -{ - public interface ISortableQuery - { - List GetSorts(); - } -} diff --git a/PoweredSoft.AdvanceQuery.Abstractions/PoweredSoft.AdvanceQuery.Abstractions.csproj b/PoweredSoft.AdvanceQuery.Abstractions/PoweredSoft.AdvanceQuery.Abstractions.csproj deleted file mode 100644 index 6dc5922..0000000 --- a/PoweredSoft.AdvanceQuery.Abstractions/PoweredSoft.AdvanceQuery.Abstractions.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/PoweredSoft.CQRS.AdvanceQuery/AdvanceQueryHandlerBase.cs b/PoweredSoft.CQRS.AdvanceQuery/AdvanceQueryHandlerBase.cs deleted file mode 100644 index fb17d54..0000000 --- a/PoweredSoft.CQRS.AdvanceQuery/AdvanceQueryHandlerBase.cs +++ /dev/null @@ -1,68 +0,0 @@ -using PoweredSoft.AdvanceQuery.Abstractions; -using PoweredSoft.DynamicQuery; -using PoweredSoft.DynamicQuery.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace PoweredSoft.CQRS.AdvanceQuery -{ - public abstract class AdvanceQueryHandlerBase - where TQuery : class - { - private readonly IQueryHandlerAsync queryHandlerAsync; - - protected AdvanceQueryHandlerBase(IQueryHandlerAsync queryHandlerAsync) - { - this.queryHandlerAsync = queryHandlerAsync; - } - - protected async Task> ProcessQuery(TQuery query, IQueryable source, - CancellationToken cancellationToken = default) - { - var criteria = CreateCriteria(query); - var options = GetOptions(query); - var interceptors = GetInterceptors(query); - - foreach (var interceptor in interceptors) - queryHandlerAsync.AddInterceptor(interceptor); - - var result = await queryHandlerAsync.ExecuteAsync(source, criteria, options, cancellationToken); - return result; - } - - protected virtual IEnumerable GetInterceptors(TQuery query) - { - return Enumerable.Empty(); - } - - protected virtual IQueryExecutionOptions GetOptions(TQuery query) - { - return new QueryExecutionOptions(); - } - - protected virtual IQueryCriteria CreateCriteria(TQuery query) - { - var ret = new QueryCriteria(); - - if (query is IPageableQuery pageableQuery) - { - ret.Page = pageableQuery.GetPage(); - ret.PageSize = pageableQuery.GetPageSize(); - } - - if (query is IFilterableQuery filterableQuery) - ret.Filters = filterableQuery.GetFilters(); - - if (query is IGroupableQuery groupableQuery) - ret.Groups = groupableQuery.GetGroups(); - - if (query is IAggregatableQuery aggregatableQuery) - ret.Aggregates = aggregatableQuery.GetAggregates(); - - return ret; - } - } -} diff --git a/PoweredSoft.CQRS.AdvanceQuery/PoweredSoft.CQRS.AdvanceQuery.csproj b/PoweredSoft.CQRS.AdvanceQuery/PoweredSoft.CQRS.AdvanceQuery.csproj deleted file mode 100644 index b999a35..0000000 --- a/PoweredSoft.CQRS.AdvanceQuery/PoweredSoft.CQRS.AdvanceQuery.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - netcoreapp3.1 - - - - - - - - - - - diff --git a/PoweredSoft.CQRS.sln b/PoweredSoft.CQRS.sln index 5a9f39d..0271202 100644 --- a/PoweredSoft.CQRS.sln +++ b/PoweredSoft.CQRS.sln @@ -19,10 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoweredSoft.CQRS.AdvanceQuery", "PoweredSoft.CQRS.AdvanceQuery\PoweredSoft.CQRS.AdvanceQuery.csproj", "{7A6DCAD7-4C01-426A-86AB-2F9AC5F19FB5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoweredSoft.AdvanceQuery.Abstractions", "PoweredSoft.AdvanceQuery.Abstractions\PoweredSoft.AdvanceQuery.Abstractions.csproj", "{FEE14DBC-7D3F-4805-8080-918CD5D52C7D}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -49,14 +45,6 @@ Global {F15B1E11-8D4C-489E-AFF7-AA144105FE46}.Debug|Any CPU.Build.0 = Debug|Any CPU {F15B1E11-8D4C-489E-AFF7-AA144105FE46}.Release|Any CPU.ActiveCfg = Release|Any CPU {F15B1E11-8D4C-489E-AFF7-AA144105FE46}.Release|Any CPU.Build.0 = Release|Any CPU - {7A6DCAD7-4C01-426A-86AB-2F9AC5F19FB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A6DCAD7-4C01-426A-86AB-2F9AC5F19FB5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A6DCAD7-4C01-426A-86AB-2F9AC5F19FB5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A6DCAD7-4C01-426A-86AB-2F9AC5F19FB5}.Release|Any CPU.Build.0 = Release|Any CPU - {FEE14DBC-7D3F-4805-8080-918CD5D52C7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FEE14DBC-7D3F-4805-8080-918CD5D52C7D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FEE14DBC-7D3F-4805-8080-918CD5D52C7D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FEE14DBC-7D3F-4805-8080-918CD5D52C7D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE