Is there a way to stipulate that the clients of a class should specify a value for a set of properties in a class. For example (see below code), Can i stipulate that "EmploymentType" property in Employment class should be specified at compile time? I know i can use parametrized constructor and such. I am specifically looking for outputting a custom warning or error during compile time. Is that possible?
public class Employment
{
public EmploymentType EmploymentType {get; set;}
}
public enum EmploymentType
{
FullTime = 1,
PartTime= 2
}
public class Client
{
Employment e = new Employment();
// if i build the above code, i should get a error or warning saying you should specify value for EmploymentType
}