qp.Where = Common.ApplicationID != 0 ? string.Format("Where M_Close=0 and M_ParentID=0 and M_ApplicationID ={0}", Common.ApplicationID) : "Where M_Close=0 and M_ParentID=0 ";大家好!本人是新手,有点看不懂上面的语句,高手能帮我解释一下吗?
如“Common.ApplicationID != 0 ?” 这里的?号代表是什么?
“: "Where M_Close=0 and M_ParentID=0 "” 这里的冒号又代表什么意思。
如“Common.ApplicationID != 0 ?” 这里的?号代表是什么?
“: "Where M_Close=0 and M_ParentID=0 "” 这里的冒号又代表什么意思。
条件运算符 (?:) 根据布尔型表达式的值返回两个值中的一个。
string S= I < 10 ? "" : "";