My solution that seems to work is this:
if (ReturnValue)
{
if (DataToCheck.BoxQuantity == 0)
{
ReturnValue = false;
}
}
if (ReturnValue)
{
if (DataToCheck.HarvestDate == DateTime.MinValue)
{
ReturnValue = false;
}
}
Here's a single line way to solve the problem:
if (ReturnValue)
{
ReturnValue &= (DataToCheck.HarvestDate !=
DateTime.MinValue);
}
return ReturnValue;