Right now I have something like this in my model class:
[Required]
public bool IsNullable { get; set; }
[Required]
[StringLength(255, ErrorMessage = "Default value is too long.")]
public string DefaultValue { get; set; }
I would like to have it so that DefaultValue is only required if isNullable is false. Is there a way to do this? I have been trying to find a solution but still have not found anything useful. Thanks for your time.