Docs: Way to short

Created on 28 Nov 2018  Â·  3Comments  Â·  Source: dotnet/docs

What I need to know is how to read rocket science like this: Where<TSource>(IEnumerable<TSource>, Func<TSource, Int32, Boolean>)

There is nowhere on the web that explains these fundamentals and yet most of C# is defined this way.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - C# Guide support-request

Most helpful comment

Hi @LJ9999 You will need to read the sections below "Generics", https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/. I don't think that there is anything about this under "classes-and-structs"

The way to read Where<TSource>(IEnumerable<TSource>, Func<TSource, Int32, Boolean>) is that the method called Where is generalised to an arbitrary type, called TSource. The method takes an IEnumerable of this type and a function from this type and an integer to a boolean value.

So if TSource is a string, then the signature would be Where<string>(IEnumerable<string>, Func<string, Int32, Boolean>)

All 3 comments

Hi @LJ9999 You will need to read the sections below "Generics", https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/. I don't think that there is anything about this under "classes-and-structs"

The way to read Where<TSource>(IEnumerable<TSource>, Func<TSource, Int32, Boolean>) is that the method called Where is generalised to an arbitrary type, called TSource. The method takes an IEnumerable of this type and a function from this type and an integer to a boolean value.

So if TSource is a string, then the signature would be Where<string>(IEnumerable<string>, Func<string, Int32, Boolean>)

Thanks for bringing this to our attention @LJ9999. I see that @mikkelbu has provided some good information about this topic. Does that help with your question? What else are you looking for?

closing due to lack of response.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

garfbradaz picture garfbradaz  Â·  3Comments

tswett picture tswett  Â·  3Comments

gmatv picture gmatv  Â·  3Comments

ygoe picture ygoe  Â·  3Comments

stjepan picture stjepan  Â·  3Comments