Skip to content
An core model binder for allowing alternative (typically shortened) property names on request models. Nothing fancy, just does that one thing pretty well.
C# PowerShell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


alias-model-binder delimiting-query-string-value-provider

Containing the Alias model binder and Delimiting Query String Value Provider

Build status GitHub

Package Version
AliasModelBinder Client nuget
AliasModelBinder Web nuget
DelimitingQueryStringValueProvider Web nuget


A model binder for ASP.NET Core. Use multiple alternative property names in your query strings.

For example, you can use this:

api/controller/action?SomePropertyName=1&SomePropertyName=2 ,

api/controller/action?SomeOtherThing=1&SomeOtherThing=2 and


at the same time.

Why might you want to do this?

  • Perhaps you've changed your request model property names and want to keep backward compatibility?
  • Perhaps you're trying to reduce query string length by using shortened property names.

How do you add this to your project?

Just add the client package to where you define your request objects, and the web package to your web project.

(These two packages are seperate, because I don't want to force your client libraries to depend on ASP.NET)

Then add an attribute to your request class

public class SomeRequest
	[BindingAlias("n")]   // btw, this would be an awful property name. Thank goodness for the modelbinder
	public int[] SomeNumbers{ get; set; }

and configure your aspnetcore project to use the model binder in Startup.cs

public void ConfigureServices(IServiceCollection services)
            .AddMvcOptions(options =>

Now you can use both your original query api/controller/action?someNumbers=1&someNumbers=2&someNumbers=3&someNumbers=4&someNumbers=5as well as api/controller/action?n=1&n=2&n=3&n=4&n=5.

Look at the AliasModelBinder.ExampleApp in the test/ folder to see a full example of an application using alias model binding.


A Value Provider for ASP.NET Core. Pass less verbose arrays in your query strings.

We've seen queries that look like this: api/controller/action?number=1&number=2&number=3&number=4&number=5. But wouldn't it be simpler if we used the Delimiting Query String Provider to write something like this instead:


Why would you want to do this?

  • Shorter query strings
  • You find this syntax clearer

How do you add this to your project?

Add the web package to your web project.

Then just configure your aspnet core to use it in Startup.cs

public void ConfigureServices(IServiceCollection services)
            .AddMvcOptions(options =>

There's an extra argument to pass a custom choice of delimiter. "," is the default.

I could have passed "_" and had query strings like api/controller/action?number=1_2_3 for example.

Now you can use this alternative syntax for all the collections in your query strings.

Look at the DelimitingQueryStringValueProvider.ExampleApp in the test/ folder to see a full example of an application using alias model binding.


All web packages have a dependancy on Microsoft.AspNetCore.Mvc.Core version 2.2.5 (not the abstractions package Microsoft.AspNetCore.Mvc.Abstractions), and so are only compatible with web projects using a version of Microsoft.AspNetCore.Mvc.Core that's binary compatible with 2.2.5.

Client packages have no dependancies.

You can’t perform that action at this time.