Skip to content

Commit e8691df

Browse files
committed
fixed attribute parameters
1 parent f8f6aa1 commit e8691df

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

example/Controllers/UserController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public UsersController(ApplicationDbContext db, IMapper mapper)
1818
// GET: /controller/users
1919
[HttpGet]
2020
[ProducesResponseType(typeof(IEnumerable<UserDto>), StatusCodes.Status200OK)]
21-
[EnableQuery<UserDto>]
21+
[EnableQuery<UserDto>(maxTop: 10)]
2222
public ActionResult<IEnumerable<UserDto>> Get()
2323
{
2424
var users = _db.Users

src/GoatQuery.AspNetCore/src/Attributes/EnableQueryAttribute.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ public sealed class EnableQueryAttribute<T> : ActionFilterAttribute
55
{
66
private readonly QueryOptions? _options;
77

8-
public EnableQueryAttribute(QueryOptions options)
8+
public EnableQueryAttribute(int maxTop)
99
{
10+
var options = new QueryOptions()
11+
{
12+
MaxTop = maxTop
13+
};
14+
1015
_options = options;
1116
}
1217

0 commit comments

Comments
 (0)