Iterating over lists in C# is often done using
for loops. This tutorial shows how the
foreach construct can be coupled with the
yield statement to create more elegant and safe code.
Following the heritage of C++, C# comes with a number of powerful features which can either be used to massively improve your code …or to make it completely unreadable. In this post we’ll discuss a technique to add new methods to already existing classes. Yes, even classes you don’t have access to such as
Rigidbody and even
string. Let’s introduce extension methods with a practical example.