The compiler appears to show an error when using a struct
/ enum
or any other value type as my MVC Model.
CS0037 Cannot convert null to 'MyEnum' because it is a non-nullable value type
I created a new MVC project (in VS 2019), created an enum
public enum MyEnum
{
One,
Two,
Three
}
and put it as model in the "About" view:
Why is that occurring?