Home
Manage Your Code
Snippet: checking for conditions in one statement - replacing if-then-else (C#)
Title: checking for conditions in one statement - replacing if-then-else Language: C#
Description: a shortcut to writing an if.. then... else statement Views: 182
Author: - - Date Added: 8/11/2008
Copy Code  
1action.guid == null ? Guid.NewGuid() : action.guid
Usage
Here it is tested if the action.guid is null - if yes a new guid is created and returned - if not the action.guid is used