Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void IfNotNull<T>(Action<T> action, T item)
- {
- if (item != null)
- action(item);
- }
- TReturn IfNotNull<TArg, TReturn>(Func<TArg, TReturn> func, TArg arg, TReturn defaultValue)
- {
- if (arg != null)
- return func(arg);
- return defaultValue;
- }
Add Comment
Please, Sign In to add comment