LINQ: Group by byte
LINQ is a powerful tool for collection (or enumeration) operating. You use functional-like syntax for filtering, grouping, transforming data. All LINQ methods work with common interface IEnumerable<T>
and usually methods do not check real type of collection, or data type. Sometimes, if you know the type of collection or generic type, you can optimize code for better performance (like in Any vs Count).
This article will show, how you can speed up grouping by specific key - byte
.
LINQ: Any() vs Count
Эта статья началась с обсуждения на Stack Overflow: Why LINQ method Any does not check Count?. Здесь мы сравним производительность методов Any
и Count != 0
.
LINQ: Any vs Count
This post started from discussion on SO: Why LINQ method Any does not check Count? This article shows a comparison of performance methods Any and Count = 0.
Xml serializer - volatile api contract
Working with some API, you expect that this API will stay stable and return the same type of result from call to call. But sometimes it does not work this way. In the article I will tell about integration with SOAP-service and volatile contracts.
Sleep well. How to stop program execution.
How many ways to sleep a thread do you know?
Debug enemy's code
I had several episodes in my .net development career when I wanted to debug foreign code. The code, I have no sources access to, DLL only. Visual Studio can debug code without sources.
This article is based on the StackOverflow question where I tried to explain Unity behavior.
Varieties of properties
Property is a flexible mechanism to access private fields (set and get value) and implement computations. Now we have different ways for implementing properties — from classic with backing field and get-set keywords to modern lambda-style. Let's find is there any difference between all these properties.
This article is based on StackOverflow question
Who can foreach
This post is about the popular question "What collection can be used in foreach statement?" If you think that correct answer is IEnumerable
, read this post :)
Null or NotNull
This topic is related to this question on StackOverflow.
Let's discover, what are CanBeNull
or NotNull
attributes? How do they work?
IndexOf with IEquatable
This topic started from question on StackOverflow:
different collections (Array and List) have different implementation of IList.IndexOf
method.