CollectionExtensionsAddIfNotNullT Method |
Adds item to the list only if it is NOT null.
Namespace:
NetQuarry
Assembly:
EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax public static void AddIfNotNull<T>(
this List<T> list,
T item
)
<ExtensionAttribute>
Public Shared Sub AddIfNotNull(Of T) (
list As List(Of T),
item As T
)
Parameters
- list
- Type: System.Collections.GenericListT
The list to which to add the item. - item
- Type: T
The item to add.
Type Parameters
- T
- The object type.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ListT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also