react to breaking change in routing
This commit is contained in:
parent
8fb187bf09
commit
d25ea4be6d
|
|
@ -10,28 +10,13 @@ namespace InlineConstraintSample.Web
|
||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
// Set up application services
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.ConfigureRouting(
|
services.AddRouting( routeOptions =>
|
||||||
routeOptions => routeOptions.ConstraintMap.Add(
|
{
|
||||||
"IsbnDigitScheme10",
|
routeOptions.ConstraintMap.Add("IsbnDigitScheme10", typeof(IsbnDigitScheme10Constraint));
|
||||||
typeof(IsbnDigitScheme10Constraint)));
|
routeOptions.ConstraintMap.Add("IsbnDigitScheme13", typeof(IsbnDigitScheme13Constraint));
|
||||||
|
});
|
||||||
services.ConfigureRouting(
|
|
||||||
routeOptions => routeOptions.ConstraintMap.Add(
|
|
||||||
"IsbnDigitScheme13",
|
|
||||||
typeof(IsbnDigitScheme10Constraint)));
|
|
||||||
|
|
||||||
// Update an existing constraint from ConstraintMap for test purpose.
|
|
||||||
services.ConfigureRouting(
|
|
||||||
routeOptions =>
|
|
||||||
{
|
|
||||||
if (routeOptions.ConstraintMap.ContainsKey("IsbnDigitScheme13"))
|
|
||||||
{
|
|
||||||
routeOptions.ConstraintMap["IsbnDigitScheme13"] = typeof(IsbnDigitScheme13Constraint);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Add MVC services to the services container
|
// Add MVC services to the services container
|
||||||
services.AddMvc();
|
services.AddMvc();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue