Collection initializer: List<T>
We're all used to write new List<int> { 1, 2, 3, 4 } or new int[] { 1, 2, 3, 4} to initialize collections with
values. Syntactically, they look similar, but the behavior is different, and you should be careful if you are worried
about
performance.
List initializer
We all used to type new List<int> { 1, 2, 3, 4 } or new int[] { 1, 2, 3, 4} to initialize collections with some values. It looks similar in syntax but differs in behavior, and you should be careful if you are concerned about performance.
Csharp (22)
.net (20)
performance (9)
benchmark (9)
LINQ (8)
collections (4)
.net6 (3)
.net8 (3)
.net48 (3)
.netcore31 (3)
MSSQL (3)
.net10 (2)
list (2)
.net9 (2)
string (2)
TSQL (2)
patterns (2)
stackoverflow (2)
HashSet (1)
dapper (1)
sql (1)
regex (1)
.net5 (1)
optimization (1)
roslyn (1)
analyzer (1)
NDepend (1)
asp.net (1)
.net471 (1)
specification (1)
repository (1)
EntityFramework (1)
xml (1)
soap (1)
CancellationToken (1)
Timer (1)
debug (1)
properties (1)
IEnumerable (1)
foreach (1)
retry (1)
circuit breaker (1)