diff --git a/src/GoatQuery.AspNetCore/src/Attributes/EnableQueryAttribute.cs b/src/GoatQuery.AspNetCore/src/Attributes/EnableQueryAttribute.cs index 91a68a2..e7564af 100644 --- a/src/GoatQuery.AspNetCore/src/Attributes/EnableQueryAttribute.cs +++ b/src/GoatQuery.AspNetCore/src/Attributes/EnableQueryAttribute.cs @@ -47,7 +47,7 @@ public override void OnActionExecuted(ActionExecutedContext context) queryString.TryGetValue("count", out var countQuery); var countString = countQuery.ToString(); - if (bool.TryParse(countString, out bool count) && !string.IsNullOrEmpty(countString)) + if (!bool.TryParse(countString, out bool count) && !string.IsNullOrEmpty(countString)) { context.Result = new BadRequestObjectResult(new { Message = "The query parameter 'Count' could not be parsed to a boolean" }); return;