Everytime I get null exception for Context in my viewmodel:
var TestId = Convert.ToInt32(Context.Parameters["Id"]);
In dotvvmStartup.cs I have this code:
config.RouteTable.Add("Default", "", "Views/index.dothtml");
config.RouteTable.Add("TestPage", "testpage/{Id?}", "Views/testpage.dothtml");
When I click on route link in index.dothml:
<dot:RouteLink RouteName="TestPage" Text="Go!" Param-Id="1" />
So I got NullReferenceException for Context also I checked in Locals Context and I saw that Context had value null. Please, do you know what I missed?
By the way I also try modify code in dotvvmStartup.cs like you can see below but I got same result with null exception for Context:
config.RouteTable.Add("Default", "", "Views/index.dothtml", null);
config.RouteTable.Add("TestPage", "testpage/{Id?}", "Views/testpage.dothtml", new { Id = 2 });