In my ASP.NET Core application, I have a BassModel
class.
In it, I have a field that is marked as required:
[Required(ErrorMessage = "Required field")]
public string InputText { get; set; }
So all other classes were inherited from this class. Now there is a second class and in that class, I am not passing this value to the controller from the view.
Simply I want to make this required attribute disabled.
I know most people suggest making that parent attribute allow null. But I don't want to do it either. Is there a better approach?