Unit testing a Roslyn Analyzer
I’ve been writing here many stories about enumeration in .NET. I know it’s hard to remember everything, specially when developing large projects with several other developers. I decided to develop ...
I’ve been writing here many stories about enumeration in .NET. I know it’s hard to remember everything, specially when developing large projects with several other developers. I decided to develop ...
Introduction The C# compiler generates different code for the foreach keyword, based on the collection type. When it uses the enumerator, it gets an enumerator instance by calling the GetEnumerato...
Introduction I frequently find other developers using a ToList() or ToArray() at the end of every LINQ query: var sequence = Enumerable.Range(0, 10) .ToList(); foreach(var number in sequence...
Finding an item I already mentioned in the first article of this series that IEnumerable: doesn’t allow random access. doesn’t give access to any other collection information. This implies...
Count() On my previous article, I analysed the usage of IEnumerable strictly based on its contract. It was brought to my attention that LINQ, short for “LINQ to Objects”, optimizes some of the des...
All .NET developers know and use IEnumerable but when reviewing code I’ve found that many fall into the same pitfalls, resulting in applications with easily avoidable performance issues. IEnumerab...
The var keyword was introduced in C# 3.0 back in 2007 and remains a topic of debate within development teams. Personally, I advocate for its use, and here’s why the arguments against it don’t sway ...
Through out the many years I’ve been using .NET, I’ve had to use many functionalities that were not yet available in .NET (computer vision, 3D rendering, physics, augmented-reality, and many more)....
NOTE: I highly suggest to also check how to use System.IO.Pipelines in .NET. It’s a feature introduced after this article was published and that allows a better implementation of the patterns sh...