Stateless is a simple library for creating state machines in C# code.
NullGuard adds null argument checks to an assembly. Very useful.
In order to convert integer number to its binary representation you can use ToString() method passing binary base as a second paremeter as follows:
It supports additional base conversion: 8, 10, or 16
Hangfire is an easy way to perform fire-and-forget, delayed and recurring tasks inside ASP.NET applications. No Windows Service required.
Strongnamer will transparently and automatically sign the assemblies you reference as part of the build process.
The FileHelpers is a free and easy to use .NET library to read/write data from delimited records in files, strings or streams.
|Description||Returns a single, specific element of a sequence||Returns a single, specific element of a sequence, or a default value if that element is not found||Returns the first element of a sequence||Returns the first element of a sequence, or a default value if no element is found|
|Exception thrown when||There are 0 or more than 1 elements in the result||There is more than one element in the result||There are no elements in the result||Only if the source is null (they all do this)|
|When to use||If exactly 1 element is expected; not 0 or more than 1||When 0 or 1 elements are expected||When more than 1 element is expected and you want only the first||When more than 1 element is expected and you want only the first. Also it is ok for the result to be empty|
It can be helpful while testing length of string and we need to have text contains e.g. 256 chars.
In order to prepare that sample text we can use the string constructor that accepts a char and the number of times to repeat it.
new string(char c, int count)
For example, to repeat a letter ‘A’ 256 times:
string result = new String('A', 256);