Empty string if null

后端 未结 4 1387
南方客
南方客 2020-12-08 14:09

I have this in my code:

SelectList(blah, \"blah\", \"blah\", cu.Customer.CustomerID.ToString())

It gives a error when it returns null, how

4条回答
  •  春和景丽
    2020-12-08 14:47

    SelectList(blah, "blah", "blah", 
    (cu.Customer.CustomerID!=null?cu.Customer.CustomerID.ToString():"")
    )
    

提交回复
热议问题