If I have a Blazor Component with a datetime property, How do I set it through the markup? I just get an error cannot convert 'int' to 'datetime?'.
public class MyComponent
{
[Parameter]
public DateTime? Value
{
get => _value;
set
{
if (_value == value) return;
_value = value;
ValueChanged.InvokeAsync(Value);
}
}
}
In razor page:
<MyComponent Value="2022/01/01"></MyComponent>
Is there way to somehow create an implicit conversion for the property?