deserializing enums

前端 未结 5 1255
轻奢々
轻奢々 2020-12-06 10:20

I have an xml in which one of the elements has an attribute that can be blank. For e.g.,



.....

         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 10:27

    object wontBeNull = couldBeNull ?? defaultIfNull;
    

    Is what I'd try. It's called Null-Coalescing operator, I use it when I want a default for null input.

提交回复
热议问题