public static Param <T?> IsNotNull <T>(this Param <T?> param) where T : struct
        {
            if (param.Value == null || !param.Value.HasValue)
            {
                throw ExceptionFactory.CreateForParamNullValidation(param, ExceptionMessages.EnsureExtensions_IsNotNull);
            }

            return(param);
        }
Ejemplo n.º 2
0
        public static Param <T> IsNotNull <T>(this Param <T> param, Throws <T> .ExceptionFnConfig exceptionFn = null) where T : class
        {
            if (param.Value == null)
            {
                if (exceptionFn != null)
                {
                    throw exceptionFn(Throws <T> .Instance)(param);
                }

                throw ExceptionFactory.CreateForParamNullValidation(param, ExceptionMessages.EnsureExtensions_IsNotNull);
            }

            return(param);
        }