예제 #1
0
        public static void AgainstNullOrEmptyGuid(Guid value, string paramName)
        {
            if (value != Guid.Empty)
            {
                return;
            }

            var exception = new GenerationException($"'{paramName}' cannot be null or empty",
                                                    new ArgumentNullException(paramName));

            throw exception;
        }
예제 #2
0
        public static void AgainstNull <T>(T value, string paramName)
        {
            if (value != null)
            {
                return;
            }

            var exception = new GenerationException($"'{paramName}' cannot be null",
                                                    new ArgumentNullException(paramName));

            throw exception;
        }
예제 #3
0
        public static void AgainstNullOrEmptyString(string value, string paramName)
        {
            if (!string.IsNullOrEmpty(value))
            {
                return;
            }

            var exception = new GenerationException($"'{paramName}' cannot be null or empty",
                                                    new ArgumentNullException(paramName));

            throw exception;
        }