Exemplo n.º 1
0
        public static void AgainstNullOrEmptyString(string value, string paramName)
        {
            if (!string.IsNullOrEmpty(value))
            {
                return;
            }

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

            throw exception;
        }
Exemplo n.º 2
0
        public static void AgainstNullOrEmptyGuid(Guid value, string paramName)
        {
            if (value != Guid.Empty)
            {
                return;
            }

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

            throw exception;
        }