Skip to content

muzammilkm/MY.AspNetCore.Mvc.ModelBinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MY.AspNetCore.Mvc.ModelBinding

Extending FromQuery to support comma separated query parameters for Model Binding in ASP.NET Core.

Usage

  • Add Reference MY.AspNetCore.Mvc.ModelBinding package
PM > Install-Package MY.AspNetCore.Mvc.ModelBinding
  • Add MY.AspNetCore.Mvc.ModelBinding to Mvc or MvcCore
using MY.AspNetCore.Mvc.ModelBinding.Extensions;

services
    .AddMvcCore(options =>
    {
        options.ModelBinderProviders.AddFromQueryAsArrayBinding();
    });
  • In Controller
using MY.AspNetCore.Mvc.ModelBinding;

[HttpGet]
public async Task<IActionResult> GetAsync([FromQueryAsArray] string[] includes)
{
    return Ok();
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages