I want to add attributes to model class properties based on some conditions
example:
Suppose the following EmployeeModel Class:
public class EmployeeModel
{
public int EmployeeId { get; set; }
[Required]
public string EmployeeName { get; set; }
}
I want to add the Required attribute on EmployeeName Based on Some Condition.
How can i implement that?