- https: // localhost: 7215/demoform/300304443-2b0c-4b94-959d-fb6132dc164f
/> https: // localhost: 7215/demoinfo? oid = 30030443-2b0c-4b94-959d-fb6132dc164f
Код: Выделить всё
Demo.razorКод: Выделить всё
@page "/DemoForm/{rowguid:guid}"
@page "/DemoInfo"
@rendermode InteractiveServer
Demo
Rowguid is @Rowguid
@code {
[Parameter, SupplyParameterFromQuery(Name = "oid")]
public Guid Rowguid { get; set; }
}
< /code>
Я ожидаю, что оба результата будут: < /p>
Rowguid is 30030443-2b0c-4b94-959d-fb6132dc164f
< /code>
Тем не менее, url 1 возвращает: < /p>
Rowguid is 00000000-0000-0000-0000-000000000000
< /code>
url 2 возвращает ожидаемый результат < /p>
Rowguid is 30030443-2b0c-4b94-959d-fb6132dc164f
Код: Выделить всё
@page "/DemoForm/{rowguid:guid}"
@page "/DemoInfo"
@rendermode InteractiveServer
Demo
Rowguid is @Rowguid
_oid is @_oid
@code {
[Parameter]
public Guid Rowguid { get; set; }
[SupplyParameterFromQuery(Name = "oid")]
public Guid? _oid { get; set; }
protected override Task OnInitializedAsync()
{
Rowguid = _oid ?? Rowguid;
return base.OnInitializedAsync();
}
}
Так что мне здесь не хватает?
Подробнее здесь: https://stackoverflow.com/questions/794 ... erty-gives