We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My route is defined as:
dotvvmConfiguration.RouteTable.Add("Test, "Test/{parentId}/{childId?}", "Views/test.dothtml");
The childId is an optional parameter.
Method call to route.BuildUrl(new {parentId, childId} throws exception.
route.BuildUrl(new {parentId, childId}
The issue is likely in DotvvmRoute.cs, method ParseParameter()
if (v.TryGetValue(name, out obj)) return prefix + obj.ToString(); return "";
--> obj is null
The workaround is not to set parameters having null values at all, but it's not ideal.
var url = childId.HasValue ? route.BuildUrl(new {parentId, childId}) : route.BuildUrl(new { parentId });
The text was updated successfully, but these errors were encountered:
27efe21
DotvvmRoute: optional parameter is ignored when null is assigned
66cb95e
resolves #483
No branches or pull requests
My route is defined as:
The childId is an optional parameter.
Method call to
route.BuildUrl(new {parentId, childId}
throws exception.The issue is likely in DotvvmRoute.cs, method ParseParameter()
--> obj is null
The workaround is not to set parameters having null values at all, but it's not ideal.
The text was updated successfully, but these errors were encountered: