Text version of the video
Slides
LINQ Tutorial – All Text Articles & Slides
LINQ Tutorial Playlist
Dot Net, SQL, Angular, JavaScript, jQuery and Bootstrap complete courses
Let us understand the difference between Select and SelectMany with an example.
In this example, the Select() method returns List of List[string]. To print all the subjects we will have to use 2 nested foreach loops.
IEnumerable[List[string]] result = Student.GetAllStudetns().Select(s =] s.Subjects);
foreach (List[string] stringList in result)
{
foreach (string str in stringList)
{
Console.WriteLine(str);
}
}
SelectMany() on the other hand, flattens queries that return lists of lists into a single list. So in this case to print all the subjects we have to use just one foreach loop.
IEnumerable[string] result = Student.GetAllStudetns().SelectMany(s =] s.Subjects);
foreach (string str in result)
{
Console.WriteLine(str);
}
Nguồn:https://wijstaanvooronzegrondrechten.org/
Xem Thêm Bài Viết Khác:https://wijstaanvooronzegrondrechten.org/cong-nghe
thank you so much sir..:)
who else liked the video just for that crisssp voice
I don't understand why there are dislikes.. May be some aliens are doing this.. Kudvenkat sir.. I am very grateful to you sir.. You are like Sachin in the field of cricket..????
this man true legend!
Excellent..!! very nice explanation..!! I want these slides. where can I find them?
this whole LINQ tutorial series is great!
thnx a lot sir
plz Upload design patterns
nice
Can you help ?
I am traning my programing:
writing a server usse system
Server:
Int32 port = 13000;
IPAddress localAddr = IPAddress.Parse("127.0.0.1");
server = new TcpListener(localAddr, port);
client
Int32 port = 13000;
TcpClient client = new TcpClient("127.0.0.1", port);
When I run the clent this wkat responce i get.
……………………………………………………………………………..
SocketException: System.Net.Sockets.SocketException (0x80004005): No connection
could be made because the target machine actively refused it 127.0.0.1:8080
at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
at Con_Ms_User.Program.Connect(String server, String message) in d:UWSTest
OrcB00231110ALLCon Ms UserCon Ms UserProgram.cs:line 26
……………………………………………………………………………..
also runing xampp at port 8080 does not work.
Thanks
Good point 🙂