System.Linq.Expressions.Error.TypeNotIEnumerable C# (CSharp) Method

TypeNotIEnumerable() static private method

ArgumentException with message like "Type '{0}' is not IEnumerable"
static private TypeNotIEnumerable ( object p0, string paramName ) : Exception
p0 object
paramName string
return Exception
        internal static Exception TypeNotIEnumerable(object p0, string paramName)
        {
            return new ArgumentException(Strings.TypeNotIEnumerable(p0), paramName);
        }
        /// <summary>

Usage Example

Esempio n. 1
0
 private static void ValidateListInitArgs(Type listType, IEnumerable <ElementInit> initializers)
 {
     if (!typeof(IEnumerable).IsAssignableFrom(listType))
     {
         throw Error.TypeNotIEnumerable(listType);
     }
     foreach (var element in initializers)
     {
         ContractUtils.RequiresNotNull(element, "initializers");
         ValidateCallInstanceType(listType, element.AddMethod);
     }
 }
All Usage Examples Of System.Linq.Expressions.Error::TypeNotIEnumerable
Error