Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace IEnumerableBug
- {
- class Program
- {
- static void Main(string[] args)
- {
- try
- {
- List<System.Int32> lst = new List<System.Int32>();
- lst.Add(999);
- IsIEnumerableNull(lst);
- Console.WriteLine("Post IsIEnumerableNull() call");
- }
- catch (Exception ex)
- {
- Console.WriteLine("-- Error --");
- Console.Write(ex.ToString());
- }
- finally
- {
- Console.WriteLine("\n\nPress any key to exit...");
- Console.ReadKey();
- }
- }
- public static void IsIEnumerableNull(IEnumerable<System.Int32> enumerableObj)
- {
- // validate params
- if (enumerableObj == null) throw new ArgumentNullException("enumerableObj");
- try {} catch (Exception /*e*/) { }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement