Method DeferredLastOrDefault
DeferredLastOrDefault<TSource>(IQueryable<TSource>)
This method is the deferred implementation of the extension method
Declaration
public static QueryDeferred<TSource> DeferredLastOrDefault<TSource>(this IQueryable<TSource> source)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
IQueryable<TSource> | source | An System.Linq.IQueryable`1 to return the last element of. |
Returns
Type | Description |
---|---|
QueryDeferred<TSource> | default(TSource) if source is empty; otherwise, the last element in source. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements of source. |
DeferredLastOrDefault<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>)
This method is the deferred implementation of the extension method
Declaration
public static QueryDeferred<TSource> DeferredLastOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
IQueryable<TSource> | source | An System.Linq.IQueryable`1 to return an element from. |
Expression<Func<TSource, System.Boolean>> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
QueryDeferred<TSource> | default(TSource) if source is empty or if no elements pass the test in the predicate function; otherwise, the last element of source that passes the test in the predicate function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements of source. |