Actually, the compiler will generate different code based on whether the ImportStatus
is nullable or not. If it is NOT nullable, so like this:
public ImportStatusEnum ImportStatus {get; set;}
then the compiler will generate this:
return file != null ? file.ImportStatus : ImportStatusEnum.Unknown;
which is the same as
if (file != null)
return file.ImportStatus;
return ImportStatusEnum.Unknown;
If the property is nullable, so like this:
public ImportStatusEnum? ImportStatus {get; set;}
//OR
public Nullable<ImportStatusEnum> ImportStatus {get; set;}
then it will do what @dasblinkenlight and @garethb have indicated in their answers.