Microsoft Boo Boo of the day! - TopicsExpress



          

Microsoft Boo Boo of the day! model.Website.UploadedFileFK = (this.UploadedFileFK != BaseBusinessEntity.UNKNOWNID) ? (Nullable) this.UploadedFileFK : null; model.Website.UploadedFileFK = this.UploadedFileFK; The conditional expression throws an error if you do not cast this.UploadedFileFK to a nullable integer. What is wrong with this picture? Nullable Integers inherit integer and as such integer values can be assigned to them as the second line of code, however conditional expressions dont care about inheritance each return type must be exactly the same type, so casting is required.
Posted on: Thu, 06 Mar 2014 21:42:41 +0000

Trending Topics



Recently Viewed Topics




© 2015