ListExtensions.LastNonNull<T>

Extension Method in ListExtensions

Declaration

public static T LastNonNull<T>(this List<T> list)
    where T : class

Description

Returns the last non-null item in the list.

Type Parameters

TThe type of the list.

Parameters

listThe list to get the item from.

Returns

TThe last non-null item in the list, or default(T) if all items are null.