I need to use Microsoft.AspNet.WebApi.Versioning in VB.NET but I cannot translate the following code:
config.AddApiVersioning(o =>
{
o.AssumeDefaultVersionWhenUnspecified = true;
o.DefaultApiVersion = new Microsoft.Web.Http.ApiVersion(1, 0);
});
var constraintResolver = new DefaultInlineConstraintResolver()
{
ConstraintMap = { ["apiVersion"] = typeof(ApiVersionRouteConstraint) }
};
config.MapHttpAttributeRoutes(constraintResolver);
In particular I have an error when I define DefaultInlineConstraintResolver:
Dim constraintResolver = New DefaultInlineConstraintResolver() With
{
.ConstraintMap = { ["apiVersion"] = GetType(ApiVersionRouteConstraint) }
}
How resolve? Tks.