get support :)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using PoweredSoft.DynamicQuery;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using PoweredSoft.DynamicQuery;
|
||||
using PoweredSoft.DynamicQuery.Core;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -15,6 +16,19 @@ namespace PoweredSoft.CQRS.DynamicQuery.AspNetCore
|
||||
public string Path { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
||||
[FromQuery(Name ="value")]
|
||||
public string QueryValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public IFilter ToFilter()
|
||||
{
|
||||
if (Type == FilterType.Composite)
|
||||
|
||||
@@ -23,6 +23,16 @@ namespace PoweredSoft.CQRS.DynamicQuery.AspNetCore.Mvc
|
||||
var result = await queryHandler.HandleAsync(query, HttpContext.RequestAborted);
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpGet, QueryControllerAuthorization]
|
||||
public async Task<IQueryExecutionResult<TDestination>> HandleGetAsync(
|
||||
[FromQuery] DynamicQuery<TSource, TDestination> query,
|
||||
[FromServices] PoweredSoft.CQRS.Abstractions.IQueryHandler<IDynamicQuery<TSource, TDestination>, IQueryExecutionResult<TDestination>> queryHandler
|
||||
)
|
||||
{
|
||||
var result = await queryHandler.HandleAsync(query, HttpContext.RequestAborted);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
[ApiController, Route("api/query/[controller]")]
|
||||
@@ -40,5 +50,15 @@ namespace PoweredSoft.CQRS.DynamicQuery.AspNetCore.Mvc
|
||||
var result = await queryHandler.HandleAsync(query, HttpContext.RequestAborted);
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpGet, QueryControllerAuthorization]
|
||||
public async Task<IQueryExecutionResult<TDestination>> HandleGetAsync(
|
||||
[FromQuery] DynamicQuery<TSource, TDestination, TParams> query,
|
||||
[FromServices] PoweredSoft.CQRS.Abstractions.IQueryHandler<IDynamicQuery<TSource, TDestination, TParams>, IQueryExecutionResult<TDestination>> queryHandler
|
||||
)
|
||||
{
|
||||
var result = await queryHandler.HandleAsync(query, HttpContext.RequestAborted);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user