TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goofy Giraffe
NA
4
0
Why only the first parameter in the definition of VB.NET Generics uses the 'Of' keyword ?
Dec 13 2011 11:00 AM
For example I have here the the full code that LINQ uses for the Enumerable.Select() method :
<System.Runtime.CompilerServices.Extension()> _
Public Shared Function [Select](Of TSource, TResult)(
ByVal source As IEnumerable(Of TSource),
ByVal selector As Func(Of TSource, TResult)
) As IEnumerable(Of TResult)
If source Is Nothing Then
Throw New ArgumentNullException("source")
End If
If selector Is Nothing Then
Throw New ArgumentNullException("selector")
End If
Return SelectIterator(Of TSource, TResult)(source, selector)
End Function
I understand the 'Of' keyword denotes a generic type parameter, but why is this keyword not used for the TResult parameter as well in the 'Public Shared Function [Select](Of TSource, TResult)' from above ?
Reply
Answers (
2
)
Error in copy-paste excel using C#
Indexing in C#