ildar-shaymukhametov_grandnode-refactorings/Grand.Core/Extensions/CommonExtensions.cs
using System;

namespace Grand.Core.Extensions
{
    public static class CommonExtensions
    {
        public static TResult Return<TInput, TResult>(this TInput o, Func<TInput, TResult> evaluator, TResult failureValue)
            where TInput : class
        {
            return o == null ? failureValue : evaluator(o);
        }
    }
}
