System.Linq.Expressions.Error.ArgumentCannotBeOfTypeVoid C# (CSharp) Méthode

ArgumentCannotBeOfTypeVoid() static private méthode

ArgumentException with message like "Argument type cannot be System.Void."
static private ArgumentCannotBeOfTypeVoid ( string paramName ) : Exception
paramName string
Résultat System.Exception
        internal static Exception ArgumentCannotBeOfTypeVoid(string paramName)
        {
            return new ArgumentException(Strings.ArgumentCannotBeOfTypeVoid, paramName);
        }
        /// <summary>

Usage Example

Exemple #1
0
        private static void Validate(Type type, bool allowByRef)
        {
            ContractUtils.RequiresNotNull(type, nameof(type));
            TypeUtils.ValidateType(type, nameof(type), allowByRef, allowPointer: false);

            if (type == typeof(void))
            {
                throw Error.ArgumentCannotBeOfTypeVoid(nameof(type));
            }
        }
All Usage Examples Of System.Linq.Expressions.Error::ArgumentCannotBeOfTypeVoid
Error