Languages
C#
Collections, LINQ and asynchronous code in modern C#.
Tooling
dotnet new console -n DemoCreate a console projectdotnet buildBuild the projectdotnet runRun the projectdotnet testRun tests in a test project or solutionCollections and LINQ
var names = new List<string> { "Ada", "Lin" };Create a mutable listnames.Add("Sam");Append an elementnames.Where(n => n.StartsWith("A")).ToList();Materialize a filtered sequencenames.Select(n => n.ToUpperInvariant());Produce a lazy projectionNulls and async
string? nickname = null;Permit null with nullable reference types enabledvar length = nickname?.Length ?? 0;Safely access a nullable stringvar text = await File.ReadAllTextAsync(path);Read without blocking the calling threadusing var stream = File.OpenRead(path);Dispose a resource at the end of its scope