Taking an excerpt code from the previous lessons about LINQ, we had these codes:
[raw][/raw]

Taking an excerpt code from the previous lessons about LINQ, we had these codes:
[raw]In the previous lesson, when I introduced you to a preview of what LINQ looks like, I ended up with this code:
[raw]And we learned that the free form syntax of LINQ is the same thing as the declarative syntax of LINQ, which is also the same with some bunch of extension methods for the IEnumerable interface, declared inside a class called Enumerable.… Read more
Finally, we now know enough to start talking about LINQ, which is an acronym for Language Integrated Query which is basically just a fancy way of doing queries and SQL-like things in C#. If you don’t know what SQL is, you should probably research about it a bit first, but, at a macro level, SQL (Structured Query Language) is just a language for interacting with databases.… Read more
In the lesson about extension methods, we learned that they are a nice way of adding extra functionality to existing types, and we did that by adding a static method inside a static class, that took a type parameter prefixed with the this keyword, like this:
[raw]So, although my original Book class does not contain a method called SellBook(), I am able to call it inside the Main() method because I declared an extension method for the Book class, and this static SellBook() method took a Book type parameter prefixed with the this keyword, that signals the compiler that the method is intended as an extension method for the Book type.… Read more
Sometimes, programmers find themselves in need of adding new functionality to already existing codes, in order to improve or complete them. If the said source code is available, the task is simple – they only need to add the required functionality and recompile.… Read more