This commit is contained in:
2018-09-04 18:58:10 +00:00
parent 077b9c7617
commit 21eb952e5a
5 changed files with 230 additions and 9 deletions

View File

@@ -98,8 +98,8 @@ namespace AyaNova.Api.Controllers
///
/// </summary>
/// <returns>Paged collection of Users with paging data</returns>
[HttpGet("List", Name = nameof(List))]//We MUST have a "Name" defined or we can't get the link for the pagination, non paged urls don't need a name
public async Task<IActionResult> List([FromQuery] PagingOptions pagingOptions)
[HttpGet("ListUsers", Name = nameof(ListUsers))]//We MUST have a "Name" defined or we can't get the link for the pagination, non paged urls don't need a name
public async Task<IActionResult> ListUsers([FromQuery] PagingOptions pagingOptions)
{
if (serverState.IsClosed)
@@ -120,7 +120,7 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
UserBiz biz = new UserBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
ApiPagedResponse<User> pr = await biz.GetManyAsync(Url, nameof(List), pagingOptions);
ApiPagedResponse<User> pr = await biz.GetManyAsync(Url, nameof(ListUsers), pagingOptions);
return Ok(new ApiOkWithPagingResponse<User>(pr));
}

View File

@@ -100,8 +100,8 @@ namespace AyaNova.Api.Controllers
///
/// </summary>
/// <returns>Paged collection of widgets with paging data</returns>
[HttpGet("List", Name = nameof(List))]//We MUST have a "Name" defined or we can't get the link for the pagination, non paged urls don't need a name
public async Task<IActionResult> List([FromQuery] PagingOptions pagingOptions)
[HttpGet("ListWidgets", Name = nameof(ListWidgets))]//We MUST have a "Name" defined or we can't get the link for the pagination, non paged urls don't need a name
public async Task<IActionResult> ListWidgets([FromQuery] PagingOptions pagingOptions)
{
if (serverState.IsClosed)
{
@@ -121,7 +121,7 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
WidgetBiz biz = new WidgetBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
ApiPagedResponse<Widget> pr = await biz.GetManyAsync(Url, nameof(List), pagingOptions);
ApiPagedResponse<Widget> pr = await biz.GetManyAsync(Url, nameof(ListWidgets), pagingOptions);
return Ok(new ApiOkWithPagingResponse<Widget>(pr));
}