Home
Library
Learn
Downloads
Support
Community
Forums
MSDN Library
.NET Development
.NET Framework 3.5
.NET Framework Class Library
System.Linq Namespace
Enumerable Class
Enumerable Methods
LastOrDefault Method
LastOrDefault(TSource) Method (IEnumerable(TSource))
LastOrDefault(TSource) Method (IEnumerable(TSource), Func(TSource, Boolean))
Related Links
Aggregate Method
All(TSource) Method
Any Method
AsEnumerable(TSource) Method
Average Method
Cast(TResult) Method
Concat(TSource) Method
Contains Method
Count Method
DefaultIfEmpty Method
Distinct Method
ElementAt(TSource) Method
ElementAtOrDefault(TSource) Method
Empty(TResult) Method
Except Method
First Method
FirstOrDefault Method
GroupBy Method
GroupJoin Method
Intersect Method
Join Method
Last Method
LongCount Method
Max Method
Min Method
OfType(TResult) Method
OrderBy Method
OrderByDescending Method
Range Method
Repeat(TResult) Method
Reverse(TSource) Method
Select Method
SelectMany Method
SequenceEqual Method
Single Method
SingleOrDefault Method
Skip(TSource) Method
SkipWhile Method
Sum Method
Take(TSource) Method
TakeWhile Method
ThenBy Method
ThenByDescending Method
ToArray(TSource) Method
ToDictionary Method
ToList(TSource) Method
ToLookup Method
Union Method
Where Method
Enumerable
.
.
::
.
LastOrDefault Method
This page is specific to:
.NET Framework Version:
3.5
Silverlight 3
.NET Framework Class Library
Enumerable
.
.
::
.
LastOrDefault Method
Returns the last element of a sequence, or a default value if no element is found.
Overload List
Name
Description
LastOrDefault
<
(Of
<
(
TSource
>
)
>
)
(IEnumerable
<
(Of
<
(
TSource
>
)
>
)
)
Returns the last element of a sequence, or a default value if the sequence contains no elements.
LastOrDefault
<
(Of
<
(
TSource
>
)
>
)
(IEnumerable
<
(Of
<
(
TSource
>
)
>
)
, Func
<
(Of
<
(
TSource, Boolean
>
)
>
)
)
Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
Top
See Also
Reference
Enumerable Class
Enumerable Members
System.Linq Namespace
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Yes
No
Do you like the tabbed code blocks?
Yes
No
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
x
Classic
Lightweight Beta
ScriptFree
Switch View