diff --git a/PoweredSoft.DynamicQuery.Core/IQueryResult.cs b/PoweredSoft.DynamicQuery.Core/IQueryResult.cs index aa2fa75..cb7b6d4 100644 --- a/PoweredSoft.DynamicQuery.Core/IQueryResult.cs +++ b/PoweredSoft.DynamicQuery.Core/IQueryResult.cs @@ -21,7 +21,7 @@ namespace PoweredSoft.DynamicQuery.Core { string GroupPath { get; set; } object GroupValue { get; set; } - bool HasSubGroups { get; set; } + bool HasSubGroups { get; } List> SubGroups { get; set; } } diff --git a/README.md b/README.md index 29c22c4..e266fe9 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ public class Startup ```csharp [HttpGet] -public IQueryExecutionResult Get( +public IQueryExecutionResult Get( [FromServices]YourContext context, [FromServices]IQueryHandler handler, [FromServices]IQueryCriteria criteria, @@ -60,7 +60,7 @@ public IQueryExecutionResult Get( } [HttpPost] -public IQueryExecutionResult Read( +public IQueryExecutionResult Read( [FromServices]YourContext context, [FromServices]IQueryHandler handler, [FromBody]IQueryCriteria criteria) @@ -75,7 +75,7 @@ public IQueryExecutionResult Read( ```csharp [HttpPost] -public async Task Read( +public async Task> Read( [FromServices]YourContext context, [FromServices]IQueryHandlerAsync handler, [FromBody]IQueryCriteria criteria) @@ -138,13 +138,15 @@ var criteria = new QueryCriteria }; var queryHandler = new QueryHandler(); -IQueryExecutionResult result = queryHandler.Execute(someQueryable, criteria); +IQueryExecutionResult result = queryHandler.Execute(someQueryable, criteria); ``` ## Query Result Here is the interfaces that represent the result of query handling execution. +> Changed in 2.x + ```csharp public interface IAggregateResult { @@ -153,23 +155,35 @@ public interface IAggregateResult object Value { get; set; } } -public interface IQueryResult +public interface IQueryResult { List Aggregates { get; } - List Data { get; } + List Data { get; } } -public interface IGroupQueryResult : IQueryResult +public interface IGroupQueryResult : IQueryResult { string GroupPath { get; set; } object GroupValue { get; set; } + bool HasSubGroups { get; } + List> SubGroups { get; set; } } -public interface IQueryExecutionResult : IQueryResult +public interface IQueryExecutionResultPaging { long TotalRecords { get; set; } long? NumberOfPages { get; set; } } + +public interface IQueryExecutionResult : IQueryResult, IQueryExecutionResultPaging +{ + +} + +public interface IQueryExecutionGroupResult : IQueryExecutionResult +{ + List> Groups { get; set; } +} ```