I have a method where it checks if a property is null or not. I know how to throw an arguement null exception if the object is null but how do you throw an arguementnullexception for a property on the object.
private int CalculateCompletedDateDiff(Recall recall)
{
if (!recall.StartDate.HasValue)
{
throw new ArgumentNullException("recall.StartDate");
}
//calculate and return
}
I am using resharper and there is purple scriggly under recall.StartDate
that says cannot resolve symbol. So, if the StartDate cannot be null what is the correct way to throw an arguementnull exception on the startdate property?