c# - What is the cleanest way to write this if..then logic? -


They both work the same way in a way better? Obviously, if I write the code, then I will know what I did, but how was it read to someone else?

  if (! String.isnllquite (return url)) {return redirection (return url); } Redirect return action ("Open", "Servicolol");  

OR

  if (! String.IsNullOrEmptE (returnUrl)) {return redirect (returnUrl); } And {Return Redirect Action ("Open", "ServiceColl"); }  

return string. Idnl li (return url)? Redirect Action ("Open", "ServiceColl"): Redirect (return URL);

I like it.

Or Optional:

  Return String.Insl LI blanket (return URL)? Redirect Action ("Open", "ServiceColl"): Redirect (return URL);  

Comments