Skip to content

Commit

Permalink
fix: Cast to object instead of T
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamess-Lucass committed Jan 12, 2024
1 parent 0c106a7 commit e4d3b42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Attributes/EnableQueryAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ public void OnActionExecuted(ActionExecutedContext context)
var (data, totalCount) = content.Apply(query, _topMax, searchBinder);

result.StatusCode = StatusCodes.Status200OK;
result.Value = new PagedResponse<T>((IQueryable<T>)data, totalCount);
// We use <object> here because when utilizing the 'select' functionality, it becomes
// an anonymous object and no longer is the type T.
result.Value = new PagedResponse<object>((IQueryable<object>)data, totalCount);
}
catch (Exception ex)
{
Expand Down

0 comments on commit e4d3b42

Please sign in to comment.