我有這樣的C#代碼:如何將默認值設置爲「n/a」,如果它爲空?
var result =
from entry in feed.Descendants(a + "entry")
let content = entry.Element(a + "content")
let properties = content.Element(m + "properties")
let notes = properties.Element(d + "Notes")
let title = properties.Element(d + "Title")
let partitionKey = properties.Element(d + "PartitionKey")
where partitionKey.Value.Substring(2, 2) == "06" && title != null && notes != null
select new Tuple<string, string>(title.Value, notes.Value);
如果我選擇筆記它僅= NULL
不是這樣做如何設置notes.Value的值在元組爲「n/a「如果notes.Value是空的?
+1解釋上! –