Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. string s = null;
  2.  
  3. if (null != myObject)
  4. {
  5. s = myObject.propertyName;
  6. }
  7.  
  8. string result = obj?.ToString();
  9.  
  10. string result = obj != null ? obj.ToString() : null;
  11.  
  12. string s = myObject == null ? null : myObject.PropertyName;
  13.  
  14. if (value != null)
  15. {
  16. return value;
  17. }
  18. else
  19. {
  20. return otherValue;
  21. }
  22.  
  23. return value != null ? value : otherValue;
  24.  
  25. return value ?? otherValue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement