My question is similar to this one.
class WorkFlowData
{
[Required]
public InputData Data{ get; set; }
public String Whatever { get; set; }
}
class GenericWorkFlowData
{
public InputData Data{ get; set; }
public String Whatever { get; set; }
}
class InputData
{
public int ObjectID { get; set; }
public string Name { get; set; }
}
I want to achieve that the property ObjectID to be required.
However, I would like to use the RequiredAttribute at class level and not property level. The validation should consider the property ObjectID of class InputData.
As you can see it above, it is not always that the ObjectID should be validated or set it as required, depending on which class InputData is being called, there should be a validation or not.