S
shapper
Hello,
I have a method as follows:
public static bool Check(string value) {
And I am calling it:
Rule.Check(User.Level.Value.ToString() ?? "")
Where Level is of type Enum UserLevel:
public UserLevel? Level { get; set; }
When I call the method Check I get an error:
Nullable object must have a value.
I tried to add ?? "" but it is not working.
I know that in this case User.Level is null.
What am I doing wrong?
Thanks,
Miguel
I have a method as follows:
public static bool Check(string value) {
And I am calling it:
Rule.Check(User.Level.Value.ToString() ?? "")
Where Level is of type Enum UserLevel:
public UserLevel? Level { get; set; }
When I call the method Check I get an error:
Nullable object must have a value.
I tried to add ?? "" but it is not working.
I know that in this case User.Level is null.
What am I doing wrong?
Thanks,
Miguel