You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a helper that coalesces to find the first non-null/empty/whitespace value. I created this helper to serve my needs (see below). I would submit a PR for this, but I am unsure how to add infinite argument helpers, given your existing helper examples are all finite.
Is there interest in such a helper for this library?
context.RegisterHelper("String.Coalesce",(context,arguments)=>{foreach(var arg in arguments){if(arg!=null){if(arg isstring s){if(!string.IsNullOrWhiteSpace(s)){returnarg;}}else{returnarg;}}}returnnull;});
It would be nice to have a helper that coalesces to find the first non-null/empty/whitespace value. I created this helper to serve my needs (see below). I would submit a PR for this, but I am unsure how to add infinite argument helpers, given your existing helper examples are all finite.
Is there interest in such a helper for this library?
The text was updated successfully, but these errors were encountered: