c# list.contains include null test code example Example: c# list contains null if (myList.Any(i => i != null)) { DoSomeThing(); }