WebApiContrib / WebAPIContrib.Core

Community Contributions for ASP.NET Core
MIT License
460 stars 116 forks source link

Error with BadRequest(ModelState) #212

Open ZajacPiotr98 opened 4 years ago

ZajacPiotr98 commented 4 years ago

When I try to return BadRequest with ModelStateDictionary using your package, app crashes. I think, app does infinitive loop in:

public static Task BadRequest(this HttpContext context, ModelStateDictionary modelState)
        {
            if (modelState == null)
            {
                throw new ArgumentNullException(nameof(modelState));
            }
            return context.BadRequest(modelState);
        }

It called BadRequest(ModelStateDictionary), so itself