├── Records ├── Records.csproj ├── Records.sln └── Program.cs ├── InitOnlySetters ├── InitOnlySetters.csproj ├── InitOnlySetters.sln └── Program.cs ├── TopLevelProgram ├── TopLevelProgram.csproj ├── Program.cs └── TopLevelProgram.sln ├── CovariantReturns ├── CovariantReturns.csproj ├── CovariantReturns.sln └── Program.cs ├── DefaultConstraint ├── DefaultConstraint.csproj ├── DefaultConstraint.sln └── Program.cs ├── ImprovedTargetTyping ├── ImprovedTargetTyping.csproj ├── Program.cs └── ImprovedTargetTyping.sln ├── NativeSizedIntegers ├── NativeSizedIntegers.csproj ├── NativeSizedIntegers.sln └── Program.cs ├── ExtendedPartialMethods ├── ExtendedPartialMethods.csproj ├── Program.cs └── ExtendedPartialMethods.sln ├── ExtensionGetEnumerator ├── ExtensionGetEnumerator.csproj ├── ExtensionGetEnumerator.sln └── Program.cs ├── RecordsAndInheritance ├── RecordsAndInheritance.csproj ├── Program.cs └── RecordsAndInheritance.sln ├── ImprovedPatternMatching ├── ImprovedPatternMatching.csproj ├── ImprovedPatternMatching.sln └── Program.cs ├── LambdaDiscardParameters ├── LambdaDiscardParameters.csproj ├── Program.cs └── LambdaDiscardParameters.sln ├── AttributesOnLocalFunctions ├── AttributesOnLocalFunctions.csproj ├── Program.cs └── AttributesOnLocalFunctions.sln ├── UnconstrainedTypeParameters ├── UnconstrainedTypeParameters.csproj ├── UnconstrainedTypeParameters.sln └── Program.cs ├── ConstructorsAndDeconstructorsInRecords ├── ConstructorsAndDeconstructorsInRecords.csproj ├── ConstructorsAndDeconstructorsInRecords.sln └── Program.cs ├── StaticAnonymousFunctions ├── StaticAnonymousFunctions.csproj ├── Program.cs └── StaticAnonymousFunctions.sln ├── FunctionPointers ├── FunctionPointers.csproj ├── Program.cs └── FunctionPointers.sln ├── README.md └── .gitignore /Records/Records.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /InitOnlySetters/InitOnlySetters.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TopLevelProgram/TopLevelProgram.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CovariantReturns/CovariantReturns.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DefaultConstraint/DefaultConstraint.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ImprovedTargetTyping/ImprovedTargetTyping.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /NativeSizedIntegers/NativeSizedIntegers.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ExtendedPartialMethods/ExtendedPartialMethods.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ExtensionGetEnumerator/ExtensionGetEnumerator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RecordsAndInheritance/RecordsAndInheritance.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ImprovedPatternMatching/ImprovedPatternMatching.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LambdaDiscardParameters/LambdaDiscardParameters.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AttributesOnLocalFunctions/AttributesOnLocalFunctions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UnconstrainedTypeParameters/UnconstrainedTypeParameters.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ConstructorsAndDeconstructorsInRecords/ConstructorsAndDeconstructorsInRecords.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /StaticAnonymousFunctions/StaticAnonymousFunctions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /AttributesOnLocalFunctions/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AttributesOnLocalFunctions 4 | { 5 | // Example from tweet https://twitter.com/okyrylchuk/status/1415385617018490881 6 | class Program 7 | { 8 | static void Main() 9 | { 10 | [Obsolete("Attribute on local function")] 11 | void LocalFunction() 12 | { 13 | Console.WriteLine("Hello World!"); 14 | } 15 | 16 | LocalFunction(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /FunctionPointers/FunctionPointers.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | true 10 | 11 | 12 | 13 | true 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /TopLevelProgram/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | // Example from tweet https://twitter.com/okyrylchuk/status/1413589024464424963 5 | 6 | Console.WriteLine(args); 7 | await Task.Delay(1000); 8 | return 0; 9 | 10 | #region C#8 version 11 | // To run C#8 version uncomment code below, comment C#9 version 12 | // And change netcoreapp3.1 in csproj file 13 | /*class Program 14 | { 15 | static async Task Main(string[] args) 16 | { 17 | Console.WriteLine(args); 18 | await Task.Delay(1000); 19 | return 0; 20 | } 21 | }*/ 22 | #endregion -------------------------------------------------------------------------------- /ExtendedPartialMethods/Program.cs: -------------------------------------------------------------------------------- 1 | namespace ExtendedPartialMethods 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1416839495132065793 4 | class Program 5 | { 6 | partial class Example 7 | { 8 | // Other than void return type is allowed 9 | public partial int A(); 10 | // Access modifiers are allowed 11 | public partial void B(); 12 | // Out params are allowed 13 | public partial void C(out int param); 14 | } 15 | 16 | partial class Example 17 | { 18 | public partial int A() => 0; 19 | public partial void B() { } 20 | public partial void C(out int param) 21 | { 22 | param = 0; 23 | } 24 | } 25 | 26 | static void Main(string[] args) 27 | { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ImprovedTargetTyping/Program.cs: -------------------------------------------------------------------------------- 1 | namespace ImprovedTargetTyping 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1412139149583437833 4 | // And from tweet https://twitter.com/okyrylchuk/status/1412502863356469253 5 | // To run C#8 version change netcoreapp3.1 in csproj file 6 | class Program 7 | { 8 | class Person { } 9 | 10 | class Student : Person { } 11 | 12 | class Customer : Person { } 13 | 14 | static void Main(string[] args) 15 | { 16 | // Target-typed new expression 17 | Student student = new (); 18 | // Target-typed new expression 19 | Customer customer = new (); 20 | bool isStudent = true; 21 | 22 | // Target-typed conditional ?: 23 | Person person = isStudent ? student : customer; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /FunctionPointers/Program.cs: -------------------------------------------------------------------------------- 1 | namespace FunctionPointers 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1417892125912489985 4 | class Program 5 | { 6 | unsafe class Example 7 | { 8 | // This method has a managed calling convention. 9 | // This is the same as leaving the 'managed' keyword off. 10 | delegate* functionPointer1; 11 | 12 | // The same as functionPointer1, but with explicit 'managed' keyword 13 | delegate* managed functionPointer2; 14 | 15 | // This method will be invoked using whatever the default unmanaged calling 16 | // convention on the runtime platform is. This is platform and architecture 17 | // dependent and is determined by the CLR at runtime. 18 | public delegate* unmanaged functionPointer3; 19 | } 20 | 21 | static void Main(string[] args) 22 | { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /StaticAnonymousFunctions/Program.cs: -------------------------------------------------------------------------------- 1 | using BenchmarkDotNet.Attributes; 2 | using BenchmarkDotNet.Running; 3 | using System.Collections.Generic; 4 | 5 | namespace StaticAnonymousFunctions 6 | { 7 | // Example from tweet https://twitter.com/okyrylchuk/status/1415008120926097411 8 | class Program 9 | { 10 | [MemoryDiagnoser] 11 | public class Benchmark 12 | { 13 | [Benchmark] 14 | public void AnounymousFunction() 15 | { 16 | var list = new List { 1, 2, 3 }; 17 | int y = 2; 18 | list.ForEach(x => x *= y); 19 | } 20 | 21 | [Benchmark] 22 | public void StaticAnounymousFunction() 23 | { 24 | var list = new List { 1, 2, 3 }; 25 | const int y = 2; 26 | list.ForEach(static x => x *= y); 27 | } 28 | } 29 | 30 | static void Main(string[] args) 31 | { 32 | BenchmarkRunner.Run(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LambdaDiscardParameters/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LambdaDiscardParameters 4 | { 5 | // Example from tweet https://twitter.com/okyrylchuk/status/1415747088592297986 6 | class Program 7 | { 8 | class Button 9 | { 10 | public event EventHandler Click; 11 | } 12 | 13 | static void Main() 14 | { 15 | void PrintHelloWorld() 16 | { 17 | Console.WriteLine("Hello World!"); 18 | } 19 | 20 | Button button = new(); 21 | button.Click += (_, _) => PrintHelloWorld(); 22 | } 23 | 24 | #region C#8 version 25 | // To run C#8 version uncomment code below, comment C#9 version 26 | // And change netcoreapp3.1 in csproj file 27 | /*static void Main() 28 | { 29 | void PrintHelloWorld() 30 | { 31 | Console.WriteLine("Hello World!"); 32 | } 33 | 34 | 35 | var button = new Button(); 36 | button.Click += (s, e) => PrintHelloWorld(); 37 | }*/ 38 | #endregion 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Records/Records.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Records", "Records.csproj", "{B2A8970F-6C32-4D96-9D22-051D4F6FC898}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B2A8970F-6C32-4D96-9D22-051D4F6FC898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {B2A8970F-6C32-4D96-9D22-051D4F6FC898}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {B2A8970F-6C32-4D96-9D22-051D4F6FC898}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {B2A8970F-6C32-4D96-9D22-051D4F6FC898}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {CD45F43A-CC24-4700-B7AB-AE25A6E4C2DD} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /RecordsAndInheritance/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RecordsAndInheritance 4 | { 5 | // Example from tweet https://twitter.com/okyrylchuk/status/1418978770220896257 6 | class Program 7 | { 8 | record Person 9 | { 10 | public string FirstName { get; init; } 11 | public string LastName { get; init; } 12 | } 13 | 14 | record Employee : Person 15 | { 16 | public string Position { get; init; } 17 | } 18 | 19 | static void Main() 20 | { 21 | Person person = new Employee 22 | { 23 | FirstName = "Oleg", 24 | LastName = "Kyrylchuk", 25 | Position = ".NET Developer" 26 | }; 27 | 28 | // Hidden virtual method copies the whole record (as Employee) 29 | Person newPerson = person with { LastName = "Bond" }; 30 | 31 | Employee employee = newPerson as Employee; 32 | Console.WriteLine(employee.FirstName); // Oleg 33 | Console.WriteLine(employee.LastName); // Bond 34 | Console.WriteLine(employee.Position); // .NET Developer 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /InitOnlySetters/InitOnlySetters.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InitOnlySetters", "InitOnlySetters.csproj", "{124B0450-F994-4DF7-90CF-A8673E06388D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {124B0450-F994-4DF7-90CF-A8673E06388D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {124B0450-F994-4DF7-90CF-A8673E06388D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {124B0450-F994-4DF7-90CF-A8673E06388D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {124B0450-F994-4DF7-90CF-A8673E06388D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1EEA9861-FE9F-4F23-8D5A-C4C6EBCA30F0} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /TopLevelProgram/TopLevelProgram.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TopLevelProgram", "TopLevelProgram.csproj", "{B2AC3D9A-B083-4829-AA98-7C941C470BB3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B2AC3D9A-B083-4829-AA98-7C941C470BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {B2AC3D9A-B083-4829-AA98-7C941C470BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {B2AC3D9A-B083-4829-AA98-7C941C470BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {B2AC3D9A-B083-4829-AA98-7C941C470BB3}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {3C329066-8D96-4D45-9AEF-E1D662FD9AE4} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /CovariantReturns/CovariantReturns.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CovariantReturns", "CovariantReturns.csproj", "{29AD4C84-8760-498D-A82B-16ADB1F27B93}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {29AD4C84-8760-498D-A82B-16ADB1F27B93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {29AD4C84-8760-498D-A82B-16ADB1F27B93}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {29AD4C84-8760-498D-A82B-16ADB1F27B93}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {29AD4C84-8760-498D-A82B-16ADB1F27B93}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {2FC5F968-30E9-47FE-AD24-9073F7CBB173} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /FunctionPointers/FunctionPointers.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunctionPointers", "FunctionPointers.csproj", "{81887F58-A6D2-42A5-89E2-CDD75E964865}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {81887F58-A6D2-42A5-89E2-CDD75E964865}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {81887F58-A6D2-42A5-89E2-CDD75E964865}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {81887F58-A6D2-42A5-89E2-CDD75E964865}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {81887F58-A6D2-42A5-89E2-CDD75E964865}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {DDF61DA8-D4C6-42AD-B36C-FBDAB5CCFB1D} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /DefaultConstraint/DefaultConstraint.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefaultConstraint", "DefaultConstraint.csproj", "{9F03DA44-CC5B-4F4A-8179-5574A6B4F4C6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9F03DA44-CC5B-4F4A-8179-5574A6B4F4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9F03DA44-CC5B-4F4A-8179-5574A6B4F4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9F03DA44-CC5B-4F4A-8179-5574A6B4F4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9F03DA44-CC5B-4F4A-8179-5574A6B4F4C6}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {0B5F0EBD-B71C-44A5-85E9-61C736759DBA} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ImprovedTargetTyping/ImprovedTargetTyping.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImprovedTargetTyping", "ImprovedTargetTyping.csproj", "{FC5FF2B9-688C-404B-9E67-43E1D7536BA7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FC5FF2B9-688C-404B-9E67-43E1D7536BA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FC5FF2B9-688C-404B-9E67-43E1D7536BA7}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FC5FF2B9-688C-404B-9E67-43E1D7536BA7}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FC5FF2B9-688C-404B-9E67-43E1D7536BA7}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {ACCB6367-9F1F-4204-9945-F63E6FDC72FF} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /NativeSizedIntegers/NativeSizedIntegers.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NativeSizedIntegers", "NativeSizedIntegers.csproj", "{1087530F-3204-4609-8B04-FD50131000D3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {1087530F-3204-4609-8B04-FD50131000D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1087530F-3204-4609-8B04-FD50131000D3}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {1087530F-3204-4609-8B04-FD50131000D3}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {1087530F-3204-4609-8B04-FD50131000D3}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {17E224DB-AA1F-4A15-9270-9B5CF049238B} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /RecordsAndInheritance/RecordsAndInheritance.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecordsAndInheritance", "RecordsAndInheritance.csproj", "{82195BB6-92C0-4EBA-94BE-6BE35CEEB83B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {82195BB6-92C0-4EBA-94BE-6BE35CEEB83B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {82195BB6-92C0-4EBA-94BE-6BE35CEEB83B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {82195BB6-92C0-4EBA-94BE-6BE35CEEB83B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {82195BB6-92C0-4EBA-94BE-6BE35CEEB83B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1ADA6AFC-D83C-45D0-8FCD-FD324E1DDFB9} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ExtendedPartialMethods/ExtendedPartialMethods.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtendedPartialMethods", "ExtendedPartialMethods.csproj", "{83AD6399-22A0-4E19-934B-7158185AF3CA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {83AD6399-22A0-4E19-934B-7158185AF3CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {83AD6399-22A0-4E19-934B-7158185AF3CA}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {83AD6399-22A0-4E19-934B-7158185AF3CA}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {83AD6399-22A0-4E19-934B-7158185AF3CA}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1355E77F-0E42-4581-AE60-350786F58BA0} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ExtensionGetEnumerator/ExtensionGetEnumerator.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtensionGetEnumerator", "ExtensionGetEnumerator.csproj", "{2C6EB662-94B0-4964-A04A-3319E9902236}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2C6EB662-94B0-4964-A04A-3319E9902236}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2C6EB662-94B0-4964-A04A-3319E9902236}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2C6EB662-94B0-4964-A04A-3319E9902236}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2C6EB662-94B0-4964-A04A-3319E9902236}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {777B89A1-8375-4781-953A-7EB94B553341} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ImprovedPatternMatching/ImprovedPatternMatching.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImprovedPatternMatching", "ImprovedPatternMatching.csproj", "{FFEBDEDA-5CDF-4D2E-BA30-0B9930A726D8}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FFEBDEDA-5CDF-4D2E-BA30-0B9930A726D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FFEBDEDA-5CDF-4D2E-BA30-0B9930A726D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FFEBDEDA-5CDF-4D2E-BA30-0B9930A726D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FFEBDEDA-5CDF-4D2E-BA30-0B9930A726D8}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1DC86B5C-971A-4EA7-BBF0-8FEFE954D639} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /LambdaDiscardParameters/LambdaDiscardParameters.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LambdaDiscardParameters", "LambdaDiscardParameters.csproj", "{20E7BAB3-295C-42D9-B6A0-BACA8965F73B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {20E7BAB3-295C-42D9-B6A0-BACA8965F73B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {20E7BAB3-295C-42D9-B6A0-BACA8965F73B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {20E7BAB3-295C-42D9-B6A0-BACA8965F73B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {20E7BAB3-295C-42D9-B6A0-BACA8965F73B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {CC197D18-DF77-4E72-B436-8660A8FCDDF5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /StaticAnonymousFunctions/StaticAnonymousFunctions.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticAnonymousFunctions", "StaticAnonymousFunctions.csproj", "{A353162E-FCCC-4ED2-B41F-F30824842201}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A353162E-FCCC-4ED2-B41F-F30824842201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A353162E-FCCC-4ED2-B41F-F30824842201}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A353162E-FCCC-4ED2-B41F-F30824842201}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A353162E-FCCC-4ED2-B41F-F30824842201}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1318B82F-E460-4F9C-83AB-51FBC5EF6B48} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /AttributesOnLocalFunctions/AttributesOnLocalFunctions.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AttributesOnLocalFunctions", "AttributesOnLocalFunctions.csproj", "{5BCC21AB-3DE9-45D8-B827-989B333B776F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {5BCC21AB-3DE9-45D8-B827-989B333B776F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {5BCC21AB-3DE9-45D8-B827-989B333B776F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {5BCC21AB-3DE9-45D8-B827-989B333B776F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {5BCC21AB-3DE9-45D8-B827-989B333B776F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {D77B87B4-7EA3-4164-91BB-344B0010CCC4} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /UnconstrainedTypeParameters/UnconstrainedTypeParameters.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnconstrainedTypeParameters", "UnconstrainedTypeParameters.csproj", "{38F4BF34-71DB-45A4-963C-E958F512484F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {38F4BF34-71DB-45A4-963C-E958F512484F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {38F4BF34-71DB-45A4-963C-E958F512484F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {38F4BF34-71DB-45A4-963C-E958F512484F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {38F4BF34-71DB-45A4-963C-E958F512484F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {5620116C-1323-41F0-823B-2BAF57051455} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ConstructorsAndDeconstructorsInRecords/ConstructorsAndDeconstructorsInRecords.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31410.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructorsAndDeconstructorsInRecords", "ConstructorsAndDeconstructorsInRecords.csproj", "{18DE2553-D44D-475D-B821-9656BCD9198F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {18DE2553-D44D-475D-B821-9656BCD9198F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {18DE2553-D44D-475D-B821-9656BCD9198F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {18DE2553-D44D-475D-B821-9656BCD9198F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {18DE2553-D44D-475D-B821-9656BCD9198F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {DF4AA832-2E39-44A8-86D7-2E01CBAA24EB} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ConstructorsAndDeconstructorsInRecords/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ConstructorsAndDeconstructorsInRecords 4 | { 5 | // Example from tweet https://twitter.com/okyrylchuk/status/1418632003004551168 6 | class Program 7 | { 8 | // Positional record 9 | record Person(string FirstName, string LastName); 10 | 11 | /* Usual record 12 | record Person 13 | { 14 | public string FirstName { get; init; } 15 | public string LastName { get; init; } 16 | 17 | // Constructor 18 | public Person(string firstName, string lastName) 19 | => (FirstName, LastName) = (firstName, lastName); 20 | 21 | // Deconstructor 22 | public void Deconstruct(out string firstName, out string lastName) 23 | => (firstName, lastName) = (FirstName, LastName); 24 | }*/ 25 | 26 | static void Main() 27 | { 28 | // Construct record 29 | var person = new Person("Oleg", "Kyrylchuk"); 30 | Console.WriteLine(person.FirstName); 31 | Console.WriteLine(person.LastName); 32 | 33 | // Deconstruct record 34 | var (firstName, lastName) = person; 35 | Console.WriteLine(firstName); 36 | Console.WriteLine(lastName); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /InitOnlySetters/Program.cs: -------------------------------------------------------------------------------- 1 | namespace InitOnlySetters 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1412848899463733249 4 | class Program 5 | { 6 | class Person 7 | { 8 | public string FirstName { get; init; } 9 | public string LastName { get; init; } 10 | } 11 | 12 | static void Main(string[] args) 13 | { 14 | var person = new Person() 15 | { 16 | FirstName = "Oleg", 17 | LastName = "Kyrylchuk" 18 | }; 19 | 20 | person.FirstName = "New first name"; // immutable 21 | person.LastName = "New last name"; // immutable 22 | } 23 | } 24 | 25 | #region C#8 version 26 | // To run C#8 version uncomment code below, comment C#9 version 27 | // And change netcoreapp3.1 in csproj file 28 | //class Program 29 | //{ 30 | // class Person 31 | // { 32 | // public string FirstName { get; set; } 33 | // public string LastName { get; set; } 34 | // } 35 | 36 | // static void Main(string[] args) 37 | // { 38 | // var person = new Person() 39 | // { 40 | // FirstName = "Oleg", 41 | // LastName = "Kyrylchuk" 42 | // }; 43 | 44 | // person.FirstName = "New first name"; // mutable 45 | // person.LastName = "New last name"; // mutable 46 | // } 47 | //} 48 | #endregion 49 | } 50 | -------------------------------------------------------------------------------- /NativeSizedIntegers/Program.cs: -------------------------------------------------------------------------------- 1 | namespace NativeSizedIntegers 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1417581217420021767 4 | class Program 5 | { 6 | static void Main() 7 | { 8 | // The compiler provides operations and conversions for 9 | // 'nint' and 'nuint' that are appropriate for integer types. 10 | nint a = 10; 11 | nint b = 7; 12 | 13 | _ = a + b; 14 | _ = a - b; 15 | 16 | nuint c = 5; 17 | nuint d = 3; 18 | 19 | _ = c + d; 20 | _ = c - d; 21 | } 22 | 23 | #region C#8 version 24 | // To run C#8 version uncomment code below, comment C#9 version 25 | // And change netcoreapp3.1 in csproj file 26 | /*static void Main() 27 | { 28 | // The native-sized integer types are represented internally 29 | // as the .NET types System.IntPtr and System.UIntPtr. 30 | // Unlike other numeric types, you can't use them as integer types. 31 | IntPtr a = 10; // you can initialize IntPtr a = new IntPtr(10); 32 | IntPtr b = 7; // you can initialize IntPtr a = new IntPtr(7); 33 | 34 | _ = a + b; 35 | _ = a - b; 36 | 37 | UIntPtr c = 5; // you can initialize UIntPtr a = new UIntPtr(5); 38 | UIntPtr d = 3; // you can initialize UIntPtr a = new UIntPtr(3); 39 | 40 | _ = c + d; 41 | _ = c - d; 42 | }*/ 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CovariantReturns/Program.cs: -------------------------------------------------------------------------------- 1 | namespace CovariantReturns 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1413226380402192385 4 | class Program 5 | { 6 | abstract class Cloneable 7 | { 8 | public abstract Cloneable Clone(); 9 | } 10 | 11 | class Person : Cloneable 12 | { 13 | public string Name { get; set; } 14 | public override Person Clone() 15 | { 16 | return new Person { Name = Name }; 17 | } 18 | 19 | static void Main(string[] args) 20 | { 21 | Person person = new Person { Name = "Oleg" }; 22 | Person clonedPerson = person.Clone(); 23 | } 24 | } 25 | } 26 | 27 | #region C#8 version 28 | // To run C#8 version uncomment code below, comment C#9 version 29 | // And change netcoreapp3.1 in csproj file 30 | /*class Program 31 | { 32 | abstract class Cloneable 33 | { 34 | public abstract Cloneable Clone(); 35 | } 36 | 37 | class Person : Cloneable 38 | { 39 | public string Name { get; set; } 40 | public override Cloneable Clone() 41 | { 42 | return new Person { Name = Name }; 43 | } 44 | } 45 | 46 | static void Main(string[] args) 47 | { 48 | Person person = new Person { Name = "Oleg" }; 49 | Person clonedPerson = (Person)person.Clone(); 50 | } 51 | }*/ 52 | #endregion 53 | } 54 | -------------------------------------------------------------------------------- /ExtensionGetEnumerator/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ExtensionGetEnumerator 5 | { 6 | // Example from tweet https://twitter.com/okyrylchuk/status/1417205582579306499 7 | public static class Extensions 8 | { 9 | public static IEnumerator GetEnumerator 10 | (this IEnumerator enumerator) => enumerator; 11 | } 12 | 13 | 14 | class Program 15 | { 16 | static void Main() 17 | { 18 | var list = new List { 1, 2, 3 }; 19 | IEnumerator enumerator = list.GetEnumerator(); 20 | foreach (int i in enumerator) 21 | { 22 | Console.WriteLine(i); 23 | } 24 | // Output: 25 | // 1 26 | // 2 27 | // 3 28 | } 29 | 30 | #region C#8 version 31 | // To run C#8 version uncomment code below, comment C#9 version 32 | // And change netcoreapp3.1 in csproj file 33 | /*static void Main() 34 | { 35 | var list = new List { 1, 2, 3 }; 36 | IEnumerator enumerator = list.GetEnumerator(); 37 | foreach (int i in enumerator) 38 | { 39 | Console.WriteLine(i); 40 | } 41 | // Compilation error without extension: 42 | // Error CS1579: foreach statement cannot operate on variables of type 43 | // 'IEnumerator' because 'IEnumerator' does not contain a public 44 | // instance definition for 'GetEnumerator'. 45 | 46 | // Compilation error with extension: 47 | // Feature 'extension GetEnumerator()' is not available in C# 8.0. 48 | // Please use language version C# 9.0 or greater. 49 | }*/ 50 | #endregion 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /UnconstrainedTypeParameters/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnconstrainedTypeParameters 4 | { 5 | // Example from tweet https://twitter.com/okyrylchuk/status/1416125980368936967 6 | class Program 7 | { 8 | #nullable enable 9 | class Example 10 | { 11 | // no overloads 12 | // handle both reference and value types 13 | public void DoSomething(T? param) 14 | { } 15 | } 16 | 17 | static void Main() 18 | { 19 | var example = new Example(); 20 | 21 | // reference type, not null 22 | example.DoSomething(new object()); 23 | // reference type, null 24 | example.DoSomething(null); 25 | // value type 26 | example.DoSomething(DateTime.Today); 27 | } 28 | 29 | #region C#8 version 30 | // To run C#8 version uncomment code below, comment C#9 version 31 | // And change netcoreapp3.1 in csproj file 32 | /*#nullable enable 33 | class Example 34 | { 35 | // for value types 36 | public void DoSomething(T? param) 37 | where T : struct 38 | { } 39 | 40 | // overload for reference types 41 | public void DoSomething(T? param) 42 | where T : class 43 | { } 44 | } 45 | 46 | static void Main() 47 | { 48 | var example = new Example(); 49 | 50 | // reference type, not null 51 | example.DoSomething(new object()); 52 | // reference type, null 53 | example.DoSomething(null); 54 | // value type 55 | example.DoSomething(DateTime.Today); 56 | }*/ 57 | #endregion 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Records/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Records 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1418310978358423552 4 | class Program 5 | { 6 | record Person 7 | { 8 | // No constructor required to initialize properties 9 | public string FirstName { get; init; } // immutable 10 | public string LastName { get; init; } // immutable 11 | } 12 | 13 | static void Main() 14 | { 15 | var person = new Person 16 | { 17 | FirstName = "Oleg", 18 | LastName = "Kyrylchuk" 19 | }; 20 | 21 | // Use with-expression to create new record from existing 22 | // specifying the changes in the values of properties 23 | var bondPerson = person with { LastName = "Bond" }; 24 | 25 | // Value base comparison 26 | var duplicatedPerson = new Person 27 | { 28 | FirstName = "Oleg", 29 | LastName = "Kyrylchuk" 30 | }; 31 | person.Equals(duplicatedPerson); // true 32 | _ = person == duplicatedPerson; // true 33 | } 34 | 35 | #region C#8 version 36 | // To run C#8 version uncomment code below, comment C#9 version 37 | // And change netcoreapp3.1 in csproj file 38 | /*class Person 39 | { 40 | // The constructor is required to initialize properties 41 | public Person(string firstName, string lastName) 42 | { 43 | FirstName = firstName; 44 | LastName = lastName; 45 | } 46 | public string FirstName { get; } // immutable 47 | public string LastName { get; } // immutable 48 | } 49 | 50 | static void Main() 51 | { 52 | var person = new Person("Oleg", "Kyrylchuk"); 53 | 54 | // No with-expression. The values to be copied 55 | // should be explicitly passed into the constructor 56 | var bondPerson = new Person(person.FirstName, "Bond"); 57 | 58 | // Reference base comparison 59 | var duplicatedPerson = new Person("Oleg", "Kyrylchuk"); 60 | person.Equals(duplicatedPerson); // false 61 | _ = person == duplicatedPerson; // false 62 | }*/ 63 | #endregion 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /DefaultConstraint/Program.cs: -------------------------------------------------------------------------------- 1 | namespace DefaultConstraint 2 | { 3 | // Example from tweet https://twitter.com/okyrylchuk/status/1416484181606010885 4 | class Program 5 | { 6 | #nullable enable 7 | class Base 8 | { 9 | // no overloads 10 | // handle both reference and value types 11 | public virtual void DoSomething(T? param) { } 12 | } 13 | 14 | class Overridden : Base 15 | { 16 | // override with default constraint 17 | // handle both reference and value types 18 | public override void DoSomething(T? param) 19 | where T : default 20 | { } 21 | } 22 | 23 | static void Main() 24 | { 25 | Base @base = new(); 26 | @base.DoSomething(1); // value type 27 | @base.DoSomething(new object()); // ref type, not null 28 | @base.DoSomething(null); // ref type, null 29 | 30 | Overridden overriden = new(); 31 | overriden.DoSomething(1); // value type 32 | overriden.DoSomething(new object()); // ref type, not null 33 | overriden.DoSomething(null); // ref type, null 34 | } 35 | 36 | #region C#8 version 37 | // To run C#8 version uncomment code below, comment C#9 version 38 | // And change netcoreapp3.1 in csproj file 39 | /*#nullable enable 40 | class Base 41 | { 42 | // for value types 43 | public virtual void DoSomething(T? param) 44 | where T : struct 45 | { } 46 | 47 | // overload for reference type 48 | public virtual void DoSomething(T? param) 49 | where T : class 50 | { } 51 | } 52 | 53 | class Overridden : Base 54 | { 55 | // override for value types 56 | public override void DoSomething(T? param) 57 | where T : struct 58 | { } 59 | 60 | // override overload for reference types 61 | public override void DoSomething(T? param) 62 | where T : class 63 | { } 64 | } 65 | 66 | static void Main() 67 | { 68 | var @base = new Base(); 69 | @base.DoSomething(1); // value type 70 | @base.DoSomething(new object()); // ref type, not null 71 | @base.DoSomething(null); // ref type, null 72 | 73 | Overridden overridden = new Overridden(); 74 | overridden.DoSomething(1); // value type 75 | overridden.DoSomething(new object()); // ref type, not null 76 | overridden.DoSomething(null); // ref type, null 77 | }*/ 78 | #endregion 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # C# 9 features 2 | In this repo you can find examples from my tweet series in Twitter about C# 9 features. 3 | 4 | Thread on Twitter https://twitter.com/okyrylchuk/status/1419393278320025600 5 | 6 | # Projects by features: 7 | 1. Target-typed new expressions - [ImprovedTargetTyping](https://github.com/okyrylchuk/csharp9_features/tree/main/ImprovedTargetTyping) 8 | 2. Target typed conditional ?: - [ImprovedTargetTyping](https://github.com/okyrylchuk/csharp9_features/tree/main/ImprovedTargetTyping) 9 | 3. Init only setters - [InitOnlySetters](https://github.com/okyrylchuk/csharp9_features/tree/main/InitOnlySetters) 10 | 4. Covariant returns - [CovariantReturns](https://github.com/okyrylchuk/csharp9_features/tree/main/CovariantReturns) 11 | 5. Top-level programs - [TopLevelProgram](https://github.com/okyrylchuk/csharp9_features/tree/main/TopLevelProgram) 12 | 6. Pattern matching - [ImprovedPatternMatching](https://github.com/okyrylchuk/csharp9_features/tree/main/ImprovedPatternMatching) 13 | 7. Relational matching - [ImprovedPatternMatching](https://github.com/okyrylchuk/csharp9_features/tree/main/ImprovedPatternMatching) 14 | 8. Pattern combinators - [ImprovedPatternMatching](https://github.com/okyrylchuk/csharp9_features/tree/main/ImprovedPatternMatching) 15 | 9. Static anonymous functions - [StaticAnonymousFunctions](https://github.com/okyrylchuk/csharp9_features/tree/main/StaticAnonymousFunctions) 16 | 10. Attributes on local functions - [AttributesOnLocalFunctions](https://github.com/okyrylchuk/csharp9_features/tree/main/AttributesOnLocalFunctions) 17 | 11. Lambda discard parameters - [LambdaDiscardParameters](https://github.com/okyrylchuk/csharp9_features/tree/main/LambdaDiscardParameters) 18 | 12. Unconstrained Type Parameters - [UnconstrainedTypeParameters](https://github.com/okyrylchuk/csharp9_features/tree/main/UnconstrainedTypeParameters) 19 | 13. Default constraint - [DefaultConstraint](https://github.com/okyrylchuk/csharp9_features/tree/main/DefaultConstraint) 20 | 14. Extended partial methods - [ExtendedPartialMethods](https://github.com/okyrylchuk/csharp9_features/tree/main/ExtendedPartialMethods) 21 | 15. Extension 'GetEnumerator' support for 'foreach' loops - [ExtensionGetEnumerator](https://github.com/okyrylchuk/csharp9_features/tree/main/ExtensionGetEnumerator) 22 | 16. Native-sized integers - [NativeSizedIntegers](https://github.com/okyrylchuk/csharp9_features/tree/main/NativeSizedIntegers) 23 | 17. Function pointers - [FunctionPointers](https://github.com/okyrylchuk/csharp9_features/tree/main/FunctionPointers) 24 | 18. Records - [Records](https://github.com/okyrylchuk/csharp9_features/tree/main/Records) 25 | 19. Records constructor and deconstructor - [ConstructorsAndDeconstructorsInRecords](https://github.com/okyrylchuk/csharp9_features/tree/main/ConstructorsAndDeconstructorsInRecords) 26 | 20. Records and inheritance - [RecordsAndInheritance](https://github.com/okyrylchuk/csharp9_features/tree/main/RecordsAndInheritance) 27 | 28 | #### For more content you can follow me on Twitter [@okyrylchuk](https://twitter.com/okyrylchuk) 29 | -------------------------------------------------------------------------------- /ImprovedPatternMatching/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ImprovedPatternMatching 4 | { 5 | class Program 6 | { 7 | // Type pattern matching 8 | // Example from tweet https://twitter.com/okyrylchuk/status/1413936703362961410 9 | static void MatchPatternByType(object o1, object o2) 10 | { 11 | var tuple = (o1, o2); 12 | if (tuple is (int, string)) 13 | { 14 | Console.WriteLine("Pattern matched in if!"); 15 | } 16 | // OR 17 | switch (tuple) 18 | { 19 | case (int, string): 20 | Console.WriteLine("Pattern matched in switch!"); 21 | break; 22 | } 23 | } 24 | 25 | // Relational pattern matching 26 | // Example from tweet https://twitter.com/okyrylchuk/status/1414286714311483392 27 | static string GetCalendarSeason(int month) => month switch 28 | { 29 | >= 3 and < 6 => "spring", 30 | >= 6 and < 9 => "summer", 31 | >= 9 and < 12 => "autumn", 32 | 12 or (>= 1 and < 3) => "winter", 33 | _ => throw new ArgumentOutOfRangeException(nameof(month), 34 | $"Unexpected month: {month}."), 35 | }; 36 | 37 | class Person { } 38 | 39 | static void Main() 40 | { 41 | MatchPatternByType(1, "test"); 42 | 43 | // Pattern combinators 44 | // Example from tweet https://twitter.com/okyrylchuk/status/1414658759721459719 45 | // Example with 'not' 46 | Person person = null; 47 | if (person is not null) { } 48 | // Example with 'or' and 'and' 49 | bool IsLetter(char c) => 50 | c is >= 'a' and <= 'z' or >= 'A' and <= 'Z'; 51 | } 52 | } 53 | 54 | #region C#8 version 55 | // To run C#8 version uncomment code below, comment C#9 version 56 | // And change netcoreapp3.1 in csproj file 57 | /*static void MatchPatternByType(object o1, object o2) 58 | { 59 | var tuple = (o1, o2); 60 | if (tuple.o1 is int && tuple.o2 is string) 61 | { 62 | Console.WriteLine("Pattern matched in if!"); 63 | } 64 | // Or 65 | switch (tuple) 66 | { 67 | case var t when t.o1 is int && t.o2 is string: 68 | Console.WriteLine("Pattern matched in switch!"); 69 | break; 70 | } 71 | } 72 | 73 | static string GetCalendarSeason(int month) => month switch 74 | { 75 | var m when m >= 3 && m < 6 => "spring", 76 | var m when m >= 6 && m < 9 => "summer", 77 | var m when m >= 9 && m < 12 => "autumn", 78 | var m when m == 12 || (m >= 1 && m < 3) => "winter", 79 | _ => throw new ArgumentOutOfRangeException(nameof(month), 80 | $"Unexpected month: {month}.") 81 | }; 82 | 83 | class Person { } 84 | 85 | static void Main() 86 | { 87 | MatchPatternByType(1, "test"); 88 | 89 | // Example with ! 90 | Person person = new Person(); 91 | if (!(person is null)) { } 92 | 93 | // Example with || and && 94 | bool IsLetter(char c) => 95 | c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'; 96 | }*/ 97 | #endregion 98 | } 99 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # Tye 66 | .tye/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.vspscc 97 | *.vssscc 98 | .builds 99 | *.pidb 100 | *.svclog 101 | *.scc 102 | 103 | # Chutzpah Test files 104 | _Chutzpah* 105 | 106 | # Visual C++ cache files 107 | ipch/ 108 | *.aps 109 | *.ncb 110 | *.opendb 111 | *.opensdf 112 | *.sdf 113 | *.cachefile 114 | *.VC.db 115 | *.VC.VC.opendb 116 | 117 | # Visual Studio profiler 118 | *.psess 119 | *.vsp 120 | *.vspx 121 | *.sap 122 | 123 | # Visual Studio Trace Files 124 | *.e2e 125 | 126 | # TFS 2012 Local Workspace 127 | $tf/ 128 | 129 | # Guidance Automation Toolkit 130 | *.gpState 131 | 132 | # ReSharper is a .NET coding add-in 133 | _ReSharper*/ 134 | *.[Rr]e[Ss]harper 135 | *.DotSettings.user 136 | 137 | # TeamCity is a build add-in 138 | _TeamCity* 139 | 140 | # DotCover is a Code Coverage Tool 141 | *.dotCover 142 | 143 | # AxoCover is a Code Coverage Tool 144 | .axoCover/* 145 | !.axoCover/settings.json 146 | 147 | # Coverlet is a free, cross platform Code Coverage Tool 148 | coverage*.json 149 | coverage*.xml 150 | coverage*.info 151 | 152 | # Visual Studio code coverage results 153 | *.coverage 154 | *.coveragexml 155 | 156 | # NCrunch 157 | _NCrunch_* 158 | .*crunch*.local.xml 159 | nCrunchTemp_* 160 | 161 | # MightyMoose 162 | *.mm.* 163 | AutoTest.Net/ 164 | 165 | # Web workbench (sass) 166 | .sass-cache/ 167 | 168 | # Installshield output folder 169 | [Ee]xpress/ 170 | 171 | # DocProject is a documentation generator add-in 172 | DocProject/buildhelp/ 173 | DocProject/Help/*.HxT 174 | DocProject/Help/*.HxC 175 | DocProject/Help/*.hhc 176 | DocProject/Help/*.hhk 177 | DocProject/Help/*.hhp 178 | DocProject/Help/Html2 179 | DocProject/Help/html 180 | 181 | # Click-Once directory 182 | publish/ 183 | 184 | # Publish Web Output 185 | *.[Pp]ublish.xml 186 | *.azurePubxml 187 | # Note: Comment the next line if you want to checkin your web deploy settings, 188 | # but database connection strings (with potential passwords) will be unencrypted 189 | *.pubxml 190 | *.publishproj 191 | 192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 193 | # checkin your Azure Web App publish settings, but sensitive information contained 194 | # in these scripts will be unencrypted 195 | PublishScripts/ 196 | 197 | # NuGet Packages 198 | *.nupkg 199 | # NuGet Symbol Packages 200 | *.snupkg 201 | # The packages folder can be ignored because of Package Restore 202 | **/[Pp]ackages/* 203 | # except build/, which is used as an MSBuild target. 204 | !**/[Pp]ackages/build/ 205 | # Uncomment if necessary however generally it will be regenerated when needed 206 | #!**/[Pp]ackages/repositories.config 207 | # NuGet v3's project.json files produces more ignorable files 208 | *.nuget.props 209 | *.nuget.targets 210 | 211 | # Microsoft Azure Build Output 212 | csx/ 213 | *.build.csdef 214 | 215 | # Microsoft Azure Emulator 216 | ecf/ 217 | rcf/ 218 | 219 | # Windows Store app package directories and files 220 | AppPackages/ 221 | BundleArtifacts/ 222 | Package.StoreAssociation.xml 223 | _pkginfo.txt 224 | *.appx 225 | *.appxbundle 226 | *.appxupload 227 | 228 | # Visual Studio cache files 229 | # files ending in .cache can be ignored 230 | *.[Cc]ache 231 | # but keep track of directories ending in .cache 232 | !?*.[Cc]ache/ 233 | 234 | # Others 235 | ClientBin/ 236 | ~$* 237 | *~ 238 | *.dbmdl 239 | *.dbproj.schemaview 240 | *.jfm 241 | *.pfx 242 | *.publishsettings 243 | orleans.codegen.cs 244 | 245 | # Including strong name files can present a security risk 246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 247 | #*.snk 248 | 249 | # Since there are multiple workflows, uncomment next line to ignore bower_components 250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 251 | #bower_components/ 252 | 253 | # RIA/Silverlight projects 254 | Generated_Code/ 255 | 256 | # Backup & report files from converting an old project file 257 | # to a newer Visual Studio version. Backup files are not needed, 258 | # because we have git ;-) 259 | _UpgradeReport_Files/ 260 | Backup*/ 261 | UpgradeLog*.XML 262 | UpgradeLog*.htm 263 | ServiceFabricBackup/ 264 | *.rptproj.bak 265 | 266 | # SQL Server files 267 | *.mdf 268 | *.ldf 269 | *.ndf 270 | 271 | # Business Intelligence projects 272 | *.rdl.data 273 | *.bim.layout 274 | *.bim_*.settings 275 | *.rptproj.rsuser 276 | *- [Bb]ackup.rdl 277 | *- [Bb]ackup ([0-9]).rdl 278 | *- [Bb]ackup ([0-9][0-9]).rdl 279 | 280 | # Microsoft Fakes 281 | FakesAssemblies/ 282 | 283 | # GhostDoc plugin setting file 284 | *.GhostDoc.xml 285 | 286 | # Node.js Tools for Visual Studio 287 | .ntvs_analysis.dat 288 | node_modules/ 289 | 290 | # Visual Studio 6 build log 291 | *.plg 292 | 293 | # Visual Studio 6 workspace options file 294 | *.opt 295 | 296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 297 | *.vbw 298 | 299 | # Visual Studio LightSwitch build output 300 | **/*.HTMLClient/GeneratedArtifacts 301 | **/*.DesktopClient/GeneratedArtifacts 302 | **/*.DesktopClient/ModelManifest.xml 303 | **/*.Server/GeneratedArtifacts 304 | **/*.Server/ModelManifest.xml 305 | _Pvt_Extensions 306 | 307 | # Paket dependency manager 308 | .paket/paket.exe 309 | paket-files/ 310 | 311 | # FAKE - F# Make 312 | .fake/ 313 | 314 | # CodeRush personal settings 315 | .cr/personal 316 | 317 | # Python Tools for Visual Studio (PTVS) 318 | __pycache__/ 319 | *.pyc 320 | 321 | # Cake - Uncomment if you are using it 322 | # tools/** 323 | # !tools/packages.config 324 | 325 | # Tabs Studio 326 | *.tss 327 | 328 | # Telerik's JustMock configuration file 329 | *.jmconfig 330 | 331 | # BizTalk build output 332 | *.btp.cs 333 | *.btm.cs 334 | *.odx.cs 335 | *.xsd.cs 336 | 337 | # OpenCover UI analysis results 338 | OpenCover/ 339 | 340 | # Azure Stream Analytics local run output 341 | ASALocalRun/ 342 | 343 | # MSBuild Binary and Structured Log 344 | *.binlog 345 | 346 | # NVidia Nsight GPU debugger configuration file 347 | *.nvuser 348 | 349 | # MFractors (Xamarin productivity tool) working folder 350 | .mfractor/ 351 | 352 | # Local History for Visual Studio 353 | .localhistory/ 354 | 355 | # BeatPulse healthcheck temp database 356 | healthchecksdb 357 | 358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 359 | MigrationBackup/ 360 | 361 | # Ionide (cross platform F# VS Code tools) working folder 362 | .ionide/ 363 | 364 | # Fody - auto-generated XML schema 365 | FodyWeavers.xsd 366 | 367 | ## 368 | ## Visual studio for Mac 369 | ## 370 | 371 | 372 | # globs 373 | Makefile.in 374 | *.userprefs 375 | *.usertasks 376 | config.make 377 | config.status 378 | aclocal.m4 379 | install-sh 380 | autom4te.cache/ 381 | *.tar.gz 382 | tarballs/ 383 | test-results/ 384 | 385 | # Mac bundle stuff 386 | *.dmg 387 | *.app 388 | 389 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 390 | # General 391 | .DS_Store 392 | .AppleDouble 393 | .LSOverride 394 | 395 | # Icon must end with two \r 396 | Icon 397 | 398 | 399 | # Thumbnails 400 | ._* 401 | 402 | # Files that might appear in the root of a volume 403 | .DocumentRevisions-V100 404 | .fseventsd 405 | .Spotlight-V100 406 | .TemporaryItems 407 | .Trashes 408 | .VolumeIcon.icns 409 | .com.apple.timemachine.donotpresent 410 | 411 | # Directories potentially created on remote AFP share 412 | .AppleDB 413 | .AppleDesktop 414 | Network Trash Folder 415 | Temporary Items 416 | .apdisk 417 | 418 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 419 | # Windows thumbnail cache files 420 | Thumbs.db 421 | ehthumbs.db 422 | ehthumbs_vista.db 423 | 424 | # Dump file 425 | *.stackdump 426 | 427 | # Folder config file 428 | [Dd]esktop.ini 429 | 430 | # Recycle Bin used on file shares 431 | $RECYCLE.BIN/ 432 | 433 | # Windows Installer files 434 | *.cab 435 | *.msi 436 | *.msix 437 | *.msm 438 | *.msp 439 | 440 | # Windows shortcuts 441 | *.lnk 442 | 443 | # JetBrains Rider 444 | .idea/ 445 | *.sln.iml 446 | 447 | ## 448 | ## Visual Studio Code 449 | ## 450 | .vscode/* 451 | !.vscode/settings.json 452 | !.vscode/tasks.json 453 | !.vscode/launch.json 454 | !.vscode/extensions.json 455 | --------------------------------------------------------------------------------