├── CSharp-10-New-Features
├── GlobalAndImplicitUsings
│ ├── GlobalUsings.cs
│ ├── GlobalAndImplicitUsings.csproj
│ └── Program.cs
├── FileScopedNamespaces
│ ├── Class1.cs
│ ├── Program.cs
│ └── FileScopedNamespaces.csproj
├── OtherImprovements
│ ├── Address.cs
│ ├── Person.cs
│ ├── OtherImprovements.csproj
│ ├── City.cs
│ └── Program.cs
├── RecordStructs
│ ├── PersonRecord.cs
│ ├── ReadOnlyPersonRecord.cs
│ ├── RecordStructs.csproj
│ ├── Program.cs
│ └── PersonRecordDecompiled.cs
├── ImprovementsToStructs
│ ├── ImprovementsToStructs.csproj
│ ├── Matrix2x2.cs
│ └── Program.cs
├── InterpolatedStringImprovements
│ ├── InterpolatedStringImprovements.csproj
│ ├── MyInterpolatedStringHandler.cs
│ └── Program.cs
├── LambdaExpressionsImprovements
│ ├── AuthorAttribute.cs
│ ├── LambdaExpressionsImprovements.csproj
│ └── Program.cs
├── StaticAbstractInInterfaces
│ ├── IParseable.cs
│ ├── Program.cs
│ ├── StaticAbstractInInterfaces.csproj
│ └── OneDigitNumber.cs
└── CSharp-10-New-Features.sln
├── CSharp-9.0-New-Features
├── TopLevelWebApp
│ ├── Pages
│ │ ├── _ViewStart.cshtml
│ │ ├── _ViewImports.cshtml
│ │ ├── Privacy.cshtml
│ │ ├── Shared
│ │ │ ├── _ValidationScriptsPartial.cshtml
│ │ │ ├── _Layout.cshtml.css
│ │ │ └── _Layout.cshtml
│ │ ├── Index.cshtml
│ │ ├── Index.cshtml.cs
│ │ ├── Privacy.cshtml.cs
│ │ ├── Error.cshtml.cs
│ │ └── Error.cshtml
│ ├── wwwroot
│ │ ├── favicon.ico
│ │ ├── js
│ │ │ └── site.js
│ │ ├── css
│ │ │ └── site.css
│ │ └── lib
│ │ │ ├── jquery-validation-unobtrusive
│ │ │ ├── LICENSE.txt
│ │ │ └── jquery.validate.unobtrusive.min.js
│ │ │ ├── jquery-validation
│ │ │ └── LICENSE.md
│ │ │ ├── bootstrap
│ │ │ ├── LICENSE
│ │ │ └── dist
│ │ │ │ └── css
│ │ │ │ ├── bootstrap-reboot.min.css
│ │ │ │ └── bootstrap-reboot.rtl.min.css
│ │ │ └── jquery
│ │ │ └── LICENSE.txt
│ ├── appsettings.json
│ ├── appsettings.Development.json
│ ├── TopLevelWebApp.csproj
│ └── Program.cs
├── InitOnlyProperties
│ ├── Point.cs
│ ├── InitOnlyProperties.csproj
│ ├── Program.cs
│ └── Person.cs
├── RecordTypes
│ ├── PersonRecord.cs
│ ├── RecordTypes.csproj
│ ├── StudentRecord.cs
│ ├── PersonRecordWithBody.cs
│ ├── Program.cs
│ └── PersonRecordDecompiled.cs
├── TopLevelPrograms
│ ├── TopLevelPrograms.csproj
│ └── Program.cs
└── NativeSizedIntegers
│ ├── NativeSizedIntegers.csproj
│ └── Program.cs
├── CSharp-7.0-New-Features
├── 06. PatternMatching
│ ├── Circle.cs
│ ├── Rectangle.cs
│ ├── App.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Program.cs
│ └── 06. PatternMatching.csproj
├── Binaries
│ ├── 08.Tuples.exe
│ ├── 03.LocalFunctions.exe
│ ├── 05.OutVariables.exe
│ ├── 09.Deconstruction.exe
│ ├── 06.PatternMatching.exe
│ ├── 07.ThrowExpressions.exe
│ ├── 04.RefReturnsAndLocals.exe
│ ├── 02.NumberLiteralsImprovements.exe
│ └── 01.MoreExpressionBodiedMembers.exe
├── 08. Tuples
│ ├── App.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Program.cs
│ └── 08. Tuples.csproj
├── 03. LocalFunctions
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 03. LocalFunctions.csproj
├── 05. OutVariables
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 05. OutVariables.csproj
├── 09. Deconstruction
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 09. Deconstruction.csproj
├── 04. RefReturnsAndLocals
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 04. RefReturnsAndLocals.csproj
├── 07. ThrowExpressions
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 07. ThrowExpressions.csproj
├── 01. MoreExpressionBodiedMembers
│ ├── App.config
│ ├── Program.cs
│ ├── Resource.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 01. MoreExpressionBodiedMembers.csproj
├── 02. NumberLiteralsImprovements
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 02. NumberLiteralsImprovements.csproj
├── Settings.StyleCop
└── CSharp-7-New-Features.sln
├── docs
├── What is new in CSharp 6.0 and 7.0.pptx
└── csharplang-Language-Version-History.md.url
├── CSharp-6.0-New-Features
├── Binaries
│ ├── 04.UsingStatic.exe
│ ├── 07.ExceptionFilters.exe
│ ├── 05.NameofExpressions.exe
│ ├── 06.StringInterpolation.exe
│ ├── 09.IndexInitializers.exe
│ ├── 10.AwaitInCatchFinally.exe
│ ├── 02.AutoPropertyEnhancements.exe
│ ├── 08.NullConditionalOperators.exe
│ └── 03.ExpressionBodiedFunctionMembers.exe
├── 04. UsingStatic
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 04. UsingStatic.csproj
├── 05. NameofExpressions
│ ├── App.config
│ ├── Person.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 05. NameofExpressions.csproj
├── 07. ExceptionFilters
│ ├── App.config
│ ├── Person.cs
│ ├── ExceptionFilterWithLogging.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 07. ExceptionFilters.csproj
├── 09. IndexInitializers
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 09. IndexInitializers.csproj
├── 10. AwaitInCatchFinally
│ ├── App.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Program.cs
│ └── 10. AwaitInCatchFinally.csproj
├── 02. AutoPropertyEnhancements
│ ├── App.config
│ ├── 2. GetterOnlyAutoProperties.cs
│ ├── 1. InitializersForAutoProperties.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 02. AutoPropertyEnhancements.csproj
├── 06. StringInterpolation
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 06. StringInterpolation.csproj
├── 08. NullConditionalOperators
│ ├── App.config
│ ├── Customer.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Program.cs
│ └── 08. NullConditionalOperators.csproj
├── 03. ExpressionBodiedFunctionMembers
│ ├── App.config
│ ├── 1. ExpressionBodiesForMethods.cs
│ ├── 2. ExpressionBodiesForProperties.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── 03. ExpressionBodiedFunctionMembers.csproj
├── 01. Roslyn
│ ├── CodeFile.cs
│ ├── RegionsRemoval.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── App.config
│ └── packages.config
├── Settings.StyleCop
└── CSharp-6-New-Features.sln
├── README.md
└── LICENSE
/CSharp-10-New-Features/GlobalAndImplicitUsings/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using System.Numerics;
2 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/FileScopedNamespaces/Class1.cs:
--------------------------------------------------------------------------------
1 | namespace ClassesNamespace;
2 |
3 | public class SomeClass
4 | {
5 | }
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/06. PatternMatching/Circle.cs:
--------------------------------------------------------------------------------
1 | public class Circle
2 | {
3 | public double Radius { get; set; }
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/InitOnlyProperties/Point.cs:
--------------------------------------------------------------------------------
1 | namespace InitOnlyProperties
2 | {
3 | public record Point(int X, int Y);
4 | }
5 |
--------------------------------------------------------------------------------
/docs/What is new in CSharp 6.0 and 7.0.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/docs/What is new in CSharp 6.0 and 7.0.pptx
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/08.Tuples.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/08.Tuples.exe
--------------------------------------------------------------------------------
/docs/csharplang-Language-Version-History.md.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=https://github.com/dotnet/csharplang/blob/master/Language-Version-History.md
3 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/04.UsingStatic.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/04.UsingStatic.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/03.LocalFunctions.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/03.LocalFunctions.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/05.OutVariables.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/05.OutVariables.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/09.Deconstruction.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/09.Deconstruction.exe
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/07.ExceptionFilters.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/07.ExceptionFilters.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/06.PatternMatching.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/06.PatternMatching.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/07.ThrowExpressions.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/07.ThrowExpressions.exe
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/05.NameofExpressions.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/05.NameofExpressions.exe
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/06.StringInterpolation.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/06.StringInterpolation.exe
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/09.IndexInitializers.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/09.IndexInitializers.exe
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/10.AwaitInCatchFinally.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/10.AwaitInCatchFinally.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/06. PatternMatching/Rectangle.cs:
--------------------------------------------------------------------------------
1 | public class Rectangle
2 | {
3 | public int Height { get; set; }
4 |
5 | public int Width { get; set; }
6 | }
7 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/04.RefReturnsAndLocals.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/04.RefReturnsAndLocals.exe
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using TopLevelWebApp
2 | @namespace TopLevelWebApp.Pages
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/CSharp-10-New-Features/OtherImprovements/Address.cs:
--------------------------------------------------------------------------------
1 | namespace OtherImprovements
2 | {
3 | public class Address
4 | {
5 | public City City { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/OtherImprovements/Person.cs:
--------------------------------------------------------------------------------
1 | namespace OtherImprovements
2 | {
3 | public class Person
4 | {
5 | public Address Address { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/02.AutoPropertyEnhancements.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/02.AutoPropertyEnhancements.exe
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/08.NullConditionalOperators.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/08.NullConditionalOperators.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/02.NumberLiteralsImprovements.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/02.NumberLiteralsImprovements.exe
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Binaries/01.MoreExpressionBodiedMembers.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-7.0-New-Features/Binaries/01.MoreExpressionBodiedMembers.exe
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/RecordTypes/PersonRecord.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RecordTypes
4 | {
5 | public record PersonRecord(string FirstName, string LastName, DateTime BirthDate);
6 | }
7 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Binaries/03.ExpressionBodiedFunctionMembers.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/CSharp-New-Features/HEAD/CSharp-6.0-New-Features/Binaries/03.ExpressionBodiedFunctionMembers.exe
--------------------------------------------------------------------------------
/CSharp-10-New-Features/RecordStructs/PersonRecord.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RecordStructs
4 | {
5 | public record struct PersonRecord(string FirstName, string LastName, DateTime BirthDate);
6 | }
7 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/RecordStructs/ReadOnlyPersonRecord.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RecordStructs
4 | {
5 | public readonly record struct ReadOnlyPersonRecord(string FirstName, string LastName, DateTime BirthDate);
6 | }
7 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/08. Tuples/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/04. UsingStatic/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/03. LocalFunctions/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/05. OutVariables/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/06. PatternMatching/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/09. Deconstruction/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Privacy.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model PrivacyModel
3 | @{
4 | ViewData["Title"] = "Privacy Policy";
5 | }
6 |
@ViewData["Title"]
7 |
8 | Use this page to detail your site's privacy policy.
9 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/05. NameofExpressions/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/07. ExceptionFilters/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/09. IndexInitializers/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/10. AwaitInCatchFinally/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/04. RefReturnsAndLocals/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/07. ThrowExpressions/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "DetailedErrors": true,
3 | "Logging": {
4 | "LogLevel": {
5 | "Default": "Information",
6 | "Microsoft.AspNetCore": "Warning"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/OtherImprovements/OtherImprovements.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/02. AutoPropertyEnhancements/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/06. StringInterpolation/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/08. NullConditionalOperators/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/ImprovementsToStructs/ImprovementsToStructs.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/01. MoreExpressionBodiedMembers/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/02. NumberLiteralsImprovements/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/03. ExpressionBodiedFunctionMembers/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/InterpolatedStringImprovements/InterpolatedStringImprovements.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/RecordTypes/RecordTypes.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | 9.0
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/OtherImprovements/City.cs:
--------------------------------------------------------------------------------
1 | namespace OtherImprovements
2 | {
3 | public class City
4 | {
5 | public City(string name)
6 | {
7 | this.Name = name;
8 | }
9 |
10 | public string Name { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/TopLevelWebApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | 9.0
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/08. NullConditionalOperators/Customer.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | public class Customer
4 | {
5 | public Customer()
6 | {
7 | this.Orders = new List();
8 | }
9 |
10 | public IEnumerable Orders { get; set; }
11 | }
12 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/InitOnlyProperties/InitOnlyProperties.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | 9.0
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | html {
2 | font-size: 14px;
3 | }
4 |
5 | @media (min-width: 768px) {
6 | html {
7 | font-size: 16px;
8 | }
9 | }
10 |
11 | html {
12 | position: relative;
13 | min-height: 100%;
14 | }
15 |
16 | body {
17 | margin-bottom: 60px;
18 | }
--------------------------------------------------------------------------------
/CSharp-10-New-Features/RecordStructs/RecordStructs.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | 10.0
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/LambdaExpressionsImprovements/AuthorAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | [AttributeUsage(AttributeTargets.Method)]
4 | public class AuthorAttribute : Attribute
5 | {
6 | public AuthorAttribute(string name)
7 | {
8 | Name = name;
9 | }
10 |
11 | public string Name { get; }
12 | }
13 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelPrograms/TopLevelPrograms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | 9.0
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/FileScopedNamespaces/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ClassesNamespace;
3 |
4 | namespace FiledScopedNamespaces;
5 |
6 | public class Program
7 | {
8 | public static void Main()
9 | {
10 | var someObject = new SomeClass();
11 | Console.WriteLine("Hello, World!");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/FileScopedNamespaces/FileScopedNamespaces.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | 10.0
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/StaticAbstractInInterfaces/IParseable.cs:
--------------------------------------------------------------------------------
1 | namespace StaticAbstractInInterfaces
2 | {
3 | public interface IParseable
4 | where TSelf : IParseable
5 | {
6 | static abstract TSelf Parse(string s);
7 |
8 | static abstract bool TryParse(string s, out TSelf result);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/RecordTypes/StudentRecord.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RecordTypes
4 | {
5 | public record StudentRecord(string FirstName, string LastName, DateTime BirthDate, string Univesity) : PersonRecord(FirstName, LastName, BirthDate);
6 |
7 | // Classes cannot inherit from records: public class Student : PersonRecord { }
8 | }
9 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Index.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model IndexModel
3 | @{
4 | ViewData["Title"] = "Home page";
5 | }
6 |
7 |
11 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/LambdaExpressionsImprovements/LambdaExpressionsImprovements.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | 10.0
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | CSharp-New-Features
2 | ===================
3 |
4 | Few samples to demonstrate the new features of the C# language (version 6.0 and 7.0)
5 |
6 | ### Videos (in Bulgarian)
7 |
8 | * What's new in C# 6 (2014) - https://www.youtube.com/watch?v=3ONWej0UnRQ
9 | * What's new in C# 6 and C# 7 (2017) - https://www.youtube.com/watch?v=Lu1o4-XovtA&t=7s
10 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/StaticAbstractInInterfaces/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace StaticAbstractInInterfaces
4 | {
5 | public static class Program
6 | {
7 | public static void Main()
8 | {
9 | var digit = OneDigitNumber.Parse("2");
10 | Console.WriteLine(digit.Value);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/NativeSizedIntegers/NativeSizedIntegers.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | AnyCPU;x86;x64
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/01. Roslyn/CodeFile.cs:
--------------------------------------------------------------------------------
1 | public class CodeFile
2 | {
3 | #region Fields
4 | private readonly T value;
5 | #endregion
6 |
7 | #region Constructors
8 | public CodeFile(T value)
9 | {
10 | this.value = value;
11 | }
12 | #endregion
13 |
14 | #region Properties
15 | public T Type => this.value;
16 | #endregion
17 | }
18 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/RecordTypes/PersonRecordWithBody.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace RecordTypes
8 | {
9 | public record PersonRecordWithBody(string FirstName, string LastName)
10 | {
11 | public string FullName => $"{this.FirstName} {this.LastName}";
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/02. AutoPropertyEnhancements/2. GetterOnlyAutoProperties.cs:
--------------------------------------------------------------------------------
1 | public class ReadOnlyPerson
2 | {
3 | public ReadOnlyPerson(string firstName)
4 | {
5 | // This line is also valid for read-only property initialization
6 | this.FirstName = firstName;
7 | }
8 |
9 | public string FirstName { get; } = "Nikolay";
10 |
11 | public string LastName { get; } = "Kostov";
12 | }
13 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/02. AutoPropertyEnhancements/1. InitializersForAutoProperties.cs:
--------------------------------------------------------------------------------
1 | public class Person
2 | {
3 | public string FirstName { get; set; } = "Nikolay";
4 |
5 | public string LastName { get; set; } = "Kostov";
6 |
7 | // This code is no longer needed:
8 | //// public Person()
9 | //// {
10 | //// this.FirstName = "Nikolay";
11 | //// this.LastName = "Kostov";
12 | //// }
13 | }
14 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/ImprovementsToStructs/Matrix2x2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ImprovementsToStructs
4 | {
5 | public struct Matrix2x2
6 | {
7 | public Matrix2x2()
8 | {
9 | this.Name = "";
10 | Console.WriteLine("Created 2x2 matrix.");
11 | }
12 |
13 | public string Name { get; set; }
14 |
15 | public int[,] Data { get; set; } = new int[2, 2];
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/StaticAbstractInInterfaces/StaticAbstractInInterfaces.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | preview
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/04. UsingStatic/Program.cs:
--------------------------------------------------------------------------------
1 | using static System.Console;
2 | using static System.Linq.Enumerable;
3 | using static System.Math;
4 |
5 | public static class Program
6 | {
7 | public static void Main()
8 | {
9 | // Using static
10 | WriteLine(Pow(2, 10)); // Instead of Console.WriteLine(Math.Pow(2, 10))
11 |
12 | // Using static in combination with extension methods
13 | Range(1, 10).ToList().ForEach(WriteLine);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelPrograms/Program.cs:
--------------------------------------------------------------------------------
1 | // See https://aka.ms/new-console-template for more information
2 | using System;
3 | using System.Threading.Tasks;
4 |
5 | Console.WriteLine("Hello, World!");
6 | Console.WriteLine(Math.Pow(2, 10));
7 |
8 | // args is available with the command-line arguments
9 | Console.WriteLine($"I've got {args.Length} argument(s).");
10 |
11 | // Tasks can also be used
12 | await Task.CompletedTask;
13 |
14 | // Return statement is also allowed
15 | return 0;
16 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/GlobalAndImplicitUsings/GlobalAndImplicitUsings.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 | 10.0
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Index.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace TopLevelWebApp.Pages
6 | {
7 | public class IndexModel : PageModel
8 | {
9 | private readonly ILogger _logger;
10 |
11 | public IndexModel(ILogger logger)
12 | {
13 | _logger = logger;
14 | }
15 |
16 | public void OnGet()
17 | {
18 |
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/02. AutoPropertyEnhancements/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | // Initializers for auto-properties
8 | var person = new Person();
9 | Console.WriteLine("{0} {1}", person.FirstName, person.LastName);
10 |
11 | // Getter-only auto-properties
12 | var readOnlyPerson = new ReadOnlyPerson("Nikolay");
13 | Console.WriteLine("{0} {1}", readOnlyPerson.FirstName, readOnlyPerson.LastName);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/01. MoreExpressionBodiedMembers/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | using (var resource = new Resource())
8 | {
9 | resource.ToStringCalledEvent += (sender, args)
10 | => Console.WriteLine("ToString() called event handled.");
11 | resource.X = 1;
12 | Console.WriteLine(resource);
13 | }
14 |
15 | Console.WriteLine("Resource is no longer needed.");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Privacy.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace TopLevelWebApp.Pages
6 | {
7 | public class PrivacyModel : PageModel
8 | {
9 | private readonly ILogger _logger;
10 |
11 | public PrivacyModel(ILogger logger)
12 | {
13 | _logger = logger;
14 | }
15 |
16 | public void OnGet()
17 | {
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/01. Roslyn/RegionsRemoval.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using Microsoft.CodeAnalysis.CSharp;
3 | using Microsoft.CodeAnalysis.CSharp.Syntax;
4 |
5 | public class RegionsRemoval : CSharpSyntaxRewriter
6 | {
7 | public RegionsRemoval()
8 | : base(true)
9 | {
10 | }
11 |
12 | public override SyntaxNode VisitRegionDirectiveTrivia(RegionDirectiveTriviaSyntax node)
13 | {
14 | return SyntaxFactory.SkippedTokensTrivia();
15 | }
16 |
17 | public override SyntaxNode VisitEndRegionDirectiveTrivia(EndRegionDirectiveTriviaSyntax node)
18 | {
19 | return SyntaxFactory.SkippedTokensTrivia();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/InitOnlyProperties/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace InitOnlyProperties
4 | {
5 | public static class Program
6 | {
7 | public static void Main()
8 | {
9 | var personWithConstructor = new Person("Niki", 3);
10 | Console.WriteLine(personWithConstructor);
11 |
12 | var personWithInitialization = new Person { Name = "Niki", Age = 10 };
13 | Console.WriteLine(personWithInitialization);
14 |
15 | var point = new Point(1, 2);
16 | var mutatedPoint = point with { X = 2, Y = 3 };
17 | Console.WriteLine(mutatedPoint.ToString());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/07. ExceptionFilters/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public class Person
4 | {
5 | private readonly string firstName;
6 | private readonly string lastName;
7 |
8 | public Person(string firstName, string lastName)
9 | {
10 | if (firstName == null)
11 | {
12 | throw new ArgumentNullException(nameof(firstName));
13 | }
14 |
15 | if (lastName == null)
16 | {
17 | throw new ArgumentNullException(nameof(lastName));
18 | }
19 |
20 | this.firstName = firstName;
21 | this.lastName = lastName;
22 | }
23 |
24 | public string Name => $"{this.firstName} {this.lastName}";
25 | }
26 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) .NET Foundation. All rights reserved.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 | these files except in compliance with the License. You may obtain a copy of the
5 | License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software distributed
10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 | specific language governing permissions and limitations under the License.
13 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/05. NameofExpressions/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public class Person
4 | {
5 | private readonly string firstName;
6 | private readonly string lastName;
7 |
8 | public Person(string firstName, string lastName)
9 | {
10 | if (firstName == null)
11 | {
12 | throw new ArgumentNullException(nameof(firstName));
13 | }
14 |
15 | if (lastName == null)
16 | {
17 | throw new ArgumentNullException(nameof(lastName));
18 | }
19 |
20 | this.firstName = firstName;
21 | this.lastName = lastName;
22 | }
23 |
24 | public string Name => string.Format("{0} {1}", this.firstName, this.lastName);
25 | }
26 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/07. ThrowExpressions/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | PrintName("Nikolay");
8 |
9 | var array = new[] { 42 };
10 | var arrayFirstValue = (array.Length > 0)
11 | ? array[0]
12 | : throw new Exception($"{nameof(array)} contains no elements.");
13 | Console.WriteLine(arrayFirstValue);
14 | }
15 |
16 | private static void PrintName(string name)
17 | {
18 | Console.WriteLine(name ?? throw new ArgumentNullException());
19 | }
20 |
21 | public static string DoMagic() => throw new NotImplementedException();
22 | }
23 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/NativeSizedIntegers/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NativeSizedIntegers
4 | {
5 | public static class Program
6 | {
7 | public static void Main()
8 | {
9 | unsafe
10 | {
11 | Console.WriteLine($"size of nint = {sizeof(nint)}");
12 | Console.WriteLine($"size of nuint = {sizeof(nuint)}");
13 |
14 | // output when run in a 64-bit process
15 | //size of nint = 8
16 | //size of nuint = 8
17 |
18 | // output when run in a 32-bit process
19 | //size of nint = 4
20 | //size of nuint = 4
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/ImprovementsToStructs/Program.cs:
--------------------------------------------------------------------------------
1 | namespace ImprovementsToStructs
2 | {
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | // Beginning with C# 10, a left-hand operand of a with expression can also be of a structure type
8 | var matrixStruct = new Matrix2x2();
9 | var newMatrix = matrixStruct with { Name = "Mutated matrix" };
10 |
11 | // Beginning with C# 10, a left-hand operand of a with expression can also be of an anonymous type
12 | var anonymousObject = new { City = "Sofia", Country = "Bulgaria" };
13 | var newAnonymousObject = anonymousObject with { City = "Plovdiv" };
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Builder;
2 | using Microsoft.Extensions.DependencyInjection;
3 | using Microsoft.Extensions.Hosting;
4 |
5 | var builder = WebApplication.CreateBuilder(args);
6 |
7 | // Add services to the container.
8 | builder.Services.AddRazorPages();
9 |
10 | var app = builder.Build();
11 |
12 | // Configure the HTTP request pipeline.
13 | if (!app.Environment.IsDevelopment())
14 | {
15 | app.UseExceptionHandler("/Error");
16 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
17 | app.UseHsts();
18 | }
19 |
20 | app.UseHttpsRedirection();
21 | app.UseStaticFiles();
22 |
23 | app.UseRouting();
24 |
25 | app.UseAuthorization();
26 |
27 | app.MapRazorPages();
28 |
29 | app.Run();
30 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/02. NumberLiteralsImprovements/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | byte n = 0b01001110; // 78 in decimal
8 | Console.WriteLine($"{nameof(n)} = {n}(10), {n:X}(16), {Convert.ToString(n, 2)}(2)");
9 |
10 | int bin = 0b1001_1010_0001_0100;
11 | int hex = 0x1b_a0_44_fe;
12 | int dec = 33_554_432;
13 | int weird = 1_2__3___4____5_____6______7_______8________9;
14 | double real = 1_000.111_1e-1_0;
15 | Console.WriteLine($"{nameof(bin)} = {bin}");
16 | Console.WriteLine($"{nameof(hex)} = {hex}");
17 | Console.WriteLine($"{nameof(dec)} = {dec}");
18 | Console.WriteLine($"{nameof(weird)} = {weird}");
19 | Console.WriteLine($"{nameof(real)} = {real}");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/06. StringInterpolation/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | // Using interpolated strings
8 | var cores = Environment.ProcessorCount;
9 | var versionInformation =
10 | $"{Environment.OSVersion}; .NET CLR {Environment.Version}; {cores} core{(cores == 1 ? null : "s")}";
11 | Console.WriteLine(versionInformation);
12 |
13 | // Expressions are allowed in interpolated strings
14 | Console.WriteLine($"Sum of 2+2 = {2 + 2}");
15 |
16 | // Combining nameof() with interpolated strings
17 | var value = 42;
18 | Console.WriteLine($"{nameof(value)} = {value:F3}");
19 |
20 | // Escaping '{' and '}' for JSON strings for example
21 | Console.WriteLine($"{{ value: {value} }}");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/InterpolatedStringImprovements/MyInterpolatedStringHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.CompilerServices;
3 |
4 | namespace InterpolatedStringImprovements
5 | {
6 | [InterpolatedStringHandler]
7 | public ref struct MyInterpolatedStringHandler
8 | {
9 | public MyInterpolatedStringHandler(int literalLength, int formattedCount)
10 | {
11 | Console.WriteLine($"MyInterpolatedStringHandler: literal length: {literalLength}, formattedCount: {formattedCount}");
12 | }
13 |
14 | public void AppendLiteral(string s)
15 | {
16 | Console.WriteLine($"AppendLiteral called: \"{s}\"");
17 | }
18 |
19 | public void AppendFormatted(T t)
20 | {
21 | Console.WriteLine($"AppendFormatted called: \"{t}\" is of type {typeof(T).Name}");
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Error.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 | using Microsoft.Extensions.Logging;
4 | using System.Diagnostics;
5 |
6 | namespace TopLevelWebApp.Pages
7 | {
8 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
9 | [IgnoreAntiforgeryToken]
10 | public class ErrorModel : PageModel
11 | {
12 | public string? RequestId { get; set; }
13 |
14 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
15 |
16 | private readonly ILogger _logger;
17 |
18 | public ErrorModel(ILogger logger)
19 | {
20 | _logger = logger;
21 | }
22 |
23 | public void OnGet()
24 | {
25 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/03. ExpressionBodiedFunctionMembers/1. ExpressionBodiesForMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public class Point : ICloneable
4 | {
5 | public Point(int x, int y)
6 | {
7 | this.X = x;
8 | this.Y = y;
9 | }
10 |
11 | public int X { get; set; }
12 |
13 | public int Y { get; set; }
14 |
15 | // Before:
16 | //// public void Print()
17 | //// {
18 | //// Console.WriteLine(this.X + " " + this.Y);
19 | //// }
20 | // After:
21 | public void Print() => Console.WriteLine(this.X + " " + this.Y);
22 |
23 | // Before:
24 | //// public object Clone()
25 | //// {
26 | //// return new Point(this.X, this.Y);
27 | //// }
28 | // After:
29 | public object Clone() => new Point(this.X, this.Y);
30 |
31 | public void Move(int x, int y)
32 | {
33 | this.X += x;
34 | this.Y += y;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/05. NameofExpressions/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public class Program
4 | {
5 | public static void Main()
6 | {
7 | // Name of static method
8 | Console.WriteLine(nameof(Main));
9 |
10 | // Name of parameter when creating ArgumentNullException
11 | try
12 | {
13 | var person = new Person(null, null);
14 | }
15 | catch (ArgumentNullException ex)
16 | {
17 | Console.WriteLine(ex.Message);
18 | }
19 |
20 | // Name of instance property
21 | new Program().NonStaticMethod();
22 |
23 | // Name of methods
24 | Console.WriteLine(nameof(string.Empty.Normalize));
25 | }
26 |
27 | public int NonStaticProperty { get; set; }
28 |
29 | public void NonStaticMethod()
30 | {
31 | Console.WriteLine(nameof(this.NonStaticProperty));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/05. OutVariables/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | // Before C# 7.0
8 | int a;
9 | if (int.TryParse("123", out a))
10 | {
11 | Console.WriteLine(a);
12 | }
13 |
14 | // C# 7.0
15 | if (int.TryParse("123", out int b))
16 | {
17 | Console.WriteLine(b);
18 | }
19 |
20 | // Infer the type of x
21 | if (int.TryParse("123", out var c))
22 | {
23 | Console.WriteLine(c);
24 | }
25 |
26 | // Infer the type of x
27 | if (int.TryParse("123", out _))
28 | {
29 | Console.WriteLine("Parsed successfully");
30 | }
31 |
32 | // In C# 7.0 _ can also be used to discard an expression result
33 | _ = int.TryParse("123", out _);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/01. Roslyn/Program.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | using Microsoft.CodeAnalysis;
4 | using Microsoft.CodeAnalysis.CSharp;
5 |
6 | public static class Program
7 | {
8 | public static void Main()
9 | {
10 | const string CodeFileName = "CodeFile.cs";
11 |
12 | // Read code contents into a string
13 | var code = File.ReadAllText(CodeFileName);
14 |
15 | // Parse the syntax tree from the string
16 | var syntaxTree = CSharpSyntaxTree.ParseText(code);
17 |
18 | // Run removal to visit all regions and clean them
19 | var removal = new RegionsRemoval();
20 | var result = removal.Visit(syntaxTree.GetRoot());
21 |
22 | // Normalize whitespaces (removing regions produce ugly formatting)
23 | result = result.NormalizeWhitespace();
24 |
25 | // Write back the result into the code file
26 | File.WriteAllText(CodeFileName, result.ToFullString());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/LambdaExpressionsImprovements/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | // Before C# 10: Action write = (string s) => Console.WriteLine(s);
4 | var write = (string s) => Console.WriteLine(s);
5 | write("test");
6 |
7 | // Before C# 10: Func parse = (string s) => int.Parse(s);
8 | var parse = (string s) => int.Parse(s); // Func
9 |
10 | // Compile error: The delegate type could not be inferred.
11 | // var parse2 = s => int.Parse(s);
12 |
13 | // Lambdas can be assigned to a weaker type
14 | object objParse = (string s) => int.Parse(s);
15 | Delegate delegateParse = (string s) => int.Parse(s);
16 |
17 | // Before C# 10: Func trigonometricFunction = Math.Sin;
18 | var trigonometricFunction = Math.Sin;
19 |
20 | // Specifiyng explicit return type on a lambda expression
21 | var value = object (bool b) => b ? 1 : "two"; // Func
22 |
23 | // Attributes on lambdas
24 | var square = [Author("Niki")] (int x) => x * x;
25 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/07. ExceptionFilters/ExceptionFilterWithLogging.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class ExceptionFilterWithLogging
4 | {
5 | public static void Demo()
6 | {
7 | try
8 | {
9 | throw new NotImplementedException();
10 | }
11 | catch (Exception ex) when (Log(ex))
12 | {
13 | }
14 | }
15 |
16 | // This method can inspect an exception “flying by” without intercepting its course.
17 | // This is a true-returning helper function which executes the side effects (logging).
18 | private static bool Log(Exception exception)
19 | {
20 | // Side effect (logging)
21 | Console.WriteLine("======== Message ========");
22 | Console.WriteLine(exception.Message);
23 | Console.WriteLine("======== Stack trace from Log() ========");
24 | Console.WriteLine(exception.StackTrace);
25 |
26 | // Continue to the catch block
27 | return true; // false, if we don't want to catch
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/03. LocalFunctions/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | Console.WriteLine(ConcatenateStrings("a", "b", "c", "d"));
8 | Console.WriteLine(UsingClosure("a", "b", "c", "d"));
9 | }
10 |
11 | private static string UsingClosure(string a, string b, string c, string d)
12 | {
13 | string Concatenate()
14 | {
15 | return a + b + c + d;
16 | }
17 |
18 | return Concatenate();
19 | }
20 |
21 | public static string ConcatenateStrings(string a, string b, string c, string d)
22 | {
23 | void Validate(string paramName, object param)
24 | {
25 | if (param == null)
26 | {
27 | throw new ArgumentException($"{paramName} cannot be null", paramName);
28 | }
29 | }
30 |
31 | Validate(nameof(a), a);
32 | Validate(nameof(b), b);
33 | Validate(nameof(c), c);
34 | Validate(nameof(d), d);
35 |
36 | return $"{a}{b}{c}{d}";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/09. IndexInitializers/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | // C# 5.0
8 | var numbersOldWay = new Dictionary
9 | {
10 | { 7, "seven" },
11 | { 9, "nine" },
12 | { 13, "thirteen" }
13 | };
14 |
15 | // C# 6.0+
16 | var numbers = new Dictionary
17 | {
18 | [7] = "seven",
19 | [9] = "nine",
20 | [13] = "thirteen"
21 | };
22 |
23 | // Same as
24 | // numbers = new Dictionary();
25 | // numbers[7] = "seven";
26 | // numbers[9] = "nine";
27 | // numbers[13] = "thirteen";
28 |
29 | // Another example
30 | var dictionary = new Dictionary
31 | {
32 | ["C#"] = "A programming language",
33 | [".NET"] = "A development platform",
34 | ["CIL"] = "Lowest-level programming language used by the .NET Framework",
35 | };
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/03. ExpressionBodiedFunctionMembers/2. ExpressionBodiesForProperties.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | public class Person
5 | {
6 | public Person()
7 | {
8 | this.Children = new List();
9 | }
10 |
11 | public Person(string firstName, string lastName)
12 | {
13 | this.Children = new List();
14 | this.FirstName = firstName;
15 | this.LastName = lastName;
16 | }
17 |
18 | public List Children { get; set; }
19 |
20 | public string FirstName { get; set; }
21 |
22 | public string LastName { get; set; }
23 |
24 | // Before:
25 | //// public string Name
26 | //// {
27 | //// get
28 | //// {
29 | //// return this.FirstName + " " + this.LastName;
30 | //// }
31 | //// }
32 | // After:
33 | public string Name => this.FirstName + " " + this.LastName;
34 |
35 | // Expression for indexer body:
36 | public Person this[string name] =>
37 | this.Children.FirstOrDefault(
38 | x => x.Name.ToLower().Contains(name.ToLower()));
39 | }
40 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Shared/_Layout.cshtml.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | for details on configuring this project to bundle and minify static web assets. */
3 |
4 | a.navbar-brand {
5 | white-space: normal;
6 | text-align: center;
7 | word-break: break-all;
8 | }
9 |
10 | a {
11 | color: #0077cc;
12 | }
13 |
14 | .btn-primary {
15 | color: #fff;
16 | background-color: #1b6ec2;
17 | border-color: #1861ac;
18 | }
19 |
20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link {
21 | color: #fff;
22 | background-color: #1b6ec2;
23 | border-color: #1861ac;
24 | }
25 |
26 | .border-top {
27 | border-top: 1px solid #e5e5e5;
28 | }
29 | .border-bottom {
30 | border-bottom: 1px solid #e5e5e5;
31 | }
32 |
33 | .box-shadow {
34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
35 | }
36 |
37 | button.accept-policy {
38 | font-size: 1rem;
39 | line-height: inherit;
40 | }
41 |
42 | .footer {
43 | position: absolute;
44 | bottom: 0;
45 | width: 100%;
46 | white-space: nowrap;
47 | line-height: 60px;
48 | }
49 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/03. ExpressionBodiedFunctionMembers/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void PrintTime() => Console.WriteLine("Current time: {0}", DateTime.Now.ToString());
6 |
7 | public static void Main()
8 | {
9 | // 1. Expression bodies on method-like members
10 | Console.WriteLine("1. Expression bodies on method-like members");
11 | PrintTime();
12 | var point = new Point(37, 77);
13 | var point2 = point.Clone() as Point;
14 | point.Move(100, 100);
15 | point2.Print();
16 | Console.WriteLine();
17 |
18 | // 2. Expression bodies on property-like function members
19 | Console.WriteLine("2. Expression bodies on property-like function members");
20 | var person = new Person("John", "Smith");
21 | person.Children.Add(new Person("Junior 1", "Smith"));
22 | person.Children.Add(new Person("Junior 2", "Smith"));
23 | person.Children.Add(new Person("Junior 3", "Smith"));
24 | Console.WriteLine(person.Name);
25 | Console.WriteLine(person["Junior 2 Smith"].Name);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014-2017 Nikolay Kostov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/01. MoreExpressionBodiedMembers/Resource.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public class Resource : IDisposable
4 | {
5 | private int x;
6 | private EventHandler toStringCalledEventHandler;
7 |
8 | // C# 7.0 - Constructor
9 | public Resource() => Console.WriteLine($"Constructing {nameof(Resource)}...");
10 |
11 | // C# 7.0 - Destructor
12 | ~Resource() => Console.WriteLine("Destructing...");
13 |
14 | // C# 7.0 - Event accessors
15 | public event EventHandler ToStringCalledEvent
16 | {
17 | add => this.toStringCalledEventHandler += value;
18 | remove => this.toStringCalledEventHandler -= value;
19 | }
20 |
21 | // C# 6.0 - Get-accessor only property
22 | public int Y => 42;
23 |
24 | // C# 7.0 - Property accessors
25 | public int X
26 | {
27 | get => this.x;
28 | set => this.x = value;
29 | }
30 |
31 | // C# 6.0 - Method
32 | public void Dispose() => Console.WriteLine("Disposing...");
33 |
34 | public override string ToString()
35 | {
36 | this.toStringCalledEventHandler(this, EventArgs.Empty);
37 | return $"({this.X}, {this.Y})";
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/StaticAbstractInInterfaces/OneDigitNumber.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace StaticAbstractInInterfaces
4 | {
5 | public class OneDigitNumber :
6 | IParseable,
7 | IAdditionOperators
8 | {
9 | public OneDigitNumber(int value)
10 | {
11 | this.Value = value % 10;
12 | }
13 |
14 | public int Value { get; }
15 |
16 | public static OneDigitNumber Parse(string s)
17 | {
18 | return new OneDigitNumber(s[0] - '0');
19 | }
20 |
21 | public static bool TryParse(string s, out OneDigitNumber result)
22 | {
23 | if (s?.Length == 1 && s[0] >= '0' && s[0] <= '9')
24 | {
25 | result = new OneDigitNumber(s[0] - '0');
26 | return true;
27 | }
28 |
29 | result = null;
30 | return false;
31 | }
32 |
33 | public static OneDigitNumber operator +(OneDigitNumber left, OneDigitNumber right)
34 | {
35 | return new OneDigitNumber(left.Value + right.Value);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/InterpolatedStringImprovements/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 |
4 | namespace InterpolatedStringImprovements
5 | {
6 | public static class Program
7 | {
8 | // Constant interpolated strings
9 | const string FirstName = "Niki", LastName = "Kostov";
10 | const string FullName = $"{FirstName} {LastName}";
11 |
12 | public static void Main()
13 | {
14 | // Interpolated string handlers
15 | var sb = new StringBuilder();
16 | sb.Append($"Hello {Environment.UserName}, how are you?");
17 |
18 | // StringBuilder is using InterpolatedStingHandler
19 | // to optimize performance and reduce string allocations
20 | // The call above will be equivalent to:
21 | sb.Append("Hello ");
22 | sb.Append(Environment.UserName);
23 | sb.Append(", how are you?");
24 |
25 | InterpolatedStringHandlerExample($"Hello {Environment.UserName}, how are you?");
26 | }
27 |
28 | public static void InterpolatedStringHandlerExample(MyInterpolatedStringHandler handler)
29 | {
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/InitOnlyProperties/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace InitOnlyProperties
4 | {
5 | public class Person
6 | {
7 | private int age;
8 |
9 | // Init-only property
10 | public string Name { get; init; }
11 |
12 | // Init-only property
13 | public int Age
14 | {
15 | get => this.age;
16 | init
17 | {
18 | if (this.age < 0)
19 | {
20 | throw new ArgumentOutOfRangeException(nameof(value));
21 | }
22 |
23 | this.age = value;
24 |
25 | // this.Name can be set here
26 | }
27 | }
28 |
29 | // Read-only property -> can be set only in constructor
30 | public DateTime BirthDate { get; }
31 |
32 | public Person()
33 | {
34 | this.BirthDate = DateTime.Now;
35 | }
36 |
37 | public Person(string name, int age)
38 | {
39 | this.Name = name;
40 | this.Age = age;
41 | }
42 |
43 | public override string ToString()
44 | {
45 | return $"{this.Name} is {this.Age} years old.";
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2021 Twitter, Inc.
4 | Copyright (c) 2011-2021 The Bootstrap Authors
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/RecordStructs/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RecordStructs
4 | {
5 | public static class Program
6 | {
7 | public static void Main()
8 | {
9 | var personRecord = new PersonRecord("John", "Doe", new DateTime(2021, 1, 1));
10 |
11 | // ToString
12 | Console.WriteLine("personRecord.ToString(): " + personRecord.ToString());
13 |
14 | // Value equality
15 | var personRecord2 = new PersonRecord("John", "Doe", new DateTime(2021, 1, 1));
16 | Console.WriteLine("personRecord == personRecord2: " + (personRecord == personRecord2));
17 | Console.WriteLine("personRecord.Equals(personRecord2): " + personRecord.Equals(personRecord2));
18 |
19 | // Non-readonly
20 | personRecord.FirstName = "Niki";
21 | personRecord.LastName = "Kostov";
22 |
23 | // Deconstruct
24 | (string firstName, string lastName, DateTime birthDate) = personRecord;
25 | Console.WriteLine($"deconstructed personRecord: ({firstName}, {lastName}, {birthDate.ToShortDateString()})");
26 |
27 | // Read-only record
28 | var readOnlyRecord = new ReadOnlyPersonRecord("Read", "Only", DateTime.Now);
29 | Console.WriteLine(readOnlyRecord);
30 | // Not available: readOnlyRecord.FirstName = firstName;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/04. RefReturnsAndLocals/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | Console.WriteLine("======== Ref return and local ref");
8 | var movies = new[] { "The Matrix", "Ex Machina", "Morgan", "Chappie" };
9 | Console.WriteLine($"Original value of {nameof(movies)}[1]: {movies[1]}");
10 | ref string result = ref FindString(1, movies);
11 | Console.WriteLine($"Return value of result: {result}");
12 | result = "CHANGED";
13 | Console.WriteLine($"New value of result: {result}");
14 | Console.WriteLine($"{nameof(movies)}[1]: {movies[1]} // We've changed the value of {nameof(movies)}[1]");
15 | Console.WriteLine();
16 |
17 | Console.WriteLine("======== Local ref");
18 | var oldVariable = "OLD VALUE";
19 | ref var newVariable = ref oldVariable; // newVariable is now pointing to oldVariable
20 | newVariable = "NEW VALUE";
21 | Console.WriteLine($"Value of {nameof(newVariable)}: {newVariable}");
22 | Console.WriteLine($"Value of {nameof(oldVariable)}: {oldVariable}");
23 | }
24 |
25 | public static ref string FindString(int index, string[] names)
26 | {
27 | if (names.Length > 0)
28 | {
29 | return ref names[index]; // return the storage location, not the value
30 | }
31 |
32 | throw new IndexOutOfRangeException($"{nameof(index)} {index} not found.");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/08. Tuples/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Tuples")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Tuples")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("c0282dc3-5c88-42d1-a1c9-97d8aed9eb1d")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/09. Deconstruction/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | // Deconstruct with Deconstruct() method
8 | var fullName = new FullName("N", "S", "K");
9 | (string fn, _, string ln) = fullName; // Discarding middle name
10 | Console.WriteLine($"{fn} {ln}");
11 |
12 | // Deconstruct with extension method
13 | (int year, int month, int day) = DateTime.Now;
14 | Console.WriteLine($"{day}.{month}.{year}");
15 | }
16 |
17 | public class FullName
18 | {
19 | public FullName(string firstName, string middleName, string lastName)
20 | {
21 | this.FirstName = firstName;
22 | this.MiddleName = middleName;
23 | this.LastName = lastName;
24 | }
25 |
26 | public string FirstName { get; set; }
27 |
28 | public string MiddleName { get; set; }
29 |
30 | public string LastName { get; set; }
31 |
32 | public void Deconstruct(out string firstName, out string middleName, out string lastName)
33 | {
34 | firstName = this.FirstName;
35 | middleName = this.MiddleName;
36 | lastName = this.LastName;
37 | }
38 | }
39 |
40 | private static void Deconstruct(this DateTime dateTime, out int year, out int month, out int day)
41 | {
42 | year = dateTime.Year;
43 | month = dateTime.Month;
44 | day = dateTime.Day;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/05. OutVariables/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("OutVariables")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("OutVariables")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("9b7eb2a8-df89-4d42-a901-001167e4d9c4")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/03. LocalFunctions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("LocalFunctions")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("LocalFunctions")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("d0e1002f-7e19-4228-8dec-77862480b9b9")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/06. PatternMatching/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("PatternMatching")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("PatternMatching")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("eb37df9d-605c-49ca-9393-41c241f00c46")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/09. Deconstruction/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Deconstruction")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Deconstruction")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("2ce2f0b2-a5e2-4bb4-98c6-c17b75b3bafa")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/07. ThrowExpressions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("ThrowExpressions")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("ThrowExpressions")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("e99f18f6-a7d6-400e-b6f5-4b476ca0e6e7")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/07. ExceptionFilters/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | Console.ForegroundColor = ConsoleColor.Green;
8 | Console.WriteLine("ExceptionFilter");
9 | Console.ResetColor();
10 | ExceptionFilter();
11 |
12 | Console.WriteLine();
13 |
14 | Console.ForegroundColor = ConsoleColor.Green;
15 | Console.WriteLine("ExceptionFilterWithLogging");
16 | Console.ResetColor();
17 | try
18 | {
19 | ExceptionFilterWithLogging.Demo();
20 | }
21 | catch (Exception ex)
22 | {
23 | Console.WriteLine("======== Stack trace from Main() ========");
24 | Console.WriteLine(ex.StackTrace);
25 | }
26 | }
27 |
28 | private static void ExceptionFilter()
29 | {
30 | Person person = null;
31 | try
32 | {
33 | string firstName = "Nikolay";
34 | string lastName = null;
35 | person = new Person(firstName, lastName);
36 | }
37 | catch (ArgumentNullException ex) when (ex.ParamName == "firstName")
38 | {
39 | Console.WriteLine("First name is null");
40 | }
41 | catch (ArgumentNullException ex) when (ex.ParamName == "lastName")
42 | {
43 | Console.WriteLine("Last name is null");
44 | }
45 |
46 | if (person != null)
47 | {
48 | Console.WriteLine(person.Name);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/04. RefReturnsAndLocals/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("RefReturnsAndLocals")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("RefReturnsAndLocals")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("a936631c-1d0c-45ad-ad30-b92e29eac95b")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/01. Roslyn/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Roslyn")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Roslyn")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("88696b3e-3bd0-45b7-b090-0e32a40cfbb1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/02. NumberLiteralsImprovements/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("NumberLiteralsImprovements")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("NumberLiteralsImprovements")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("79c02ea4-cbc9-4758-bd04-2fb4fa4415c2")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/01. MoreExpressionBodiedMembers/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("MoreExpressionBodiedMembers")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("MoreExpressionBodiedMembers")]
12 | [assembly: AssemblyCopyright("Copyright © 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("743b7f47-bfba-4ff7-9fb7-8c441e645142")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/04. UsingStatic/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("UsingStatic")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("UsingStatic")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("1b76d878-2f96-4adc-bffd-d4fb743e6a86")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/05. NameofExpressions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NameofExpressions")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NameofExpressions")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3b70b428-f759-494e-b033-a7fcaeb06788")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/07. ExceptionFilters/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ExceptionFilters")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ExceptionFilters")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("fb7a5c8f-39dd-41da-9da0-f27de2bf0604")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/09. IndexInitializers/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("IndexInitializers")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("IndexInitializers")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("abed5388-ef91-449b-8b0f-397c504bfbe7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/06. StringInterpolation/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("StringInterpolation")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("StringInterpolation")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("882725ad-8aeb-4f17-9f08-da28b78547e7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/10. AwaitInCatchFinally/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AwaitInCatchFinally")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AwaitInCatchFinally")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("cc4e5072-1b81-4faa-a1eb-11164df5a38c")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/02. AutoPropertyEnhancements/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AutoPropertyEnhancements")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AutoPropertyEnhancements")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("9b820676-7425-4f37-8b46-27bc9932d52b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/08. NullConditionalOperators/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NullConditionalOperators")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NullConditionalOperators")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("8e14046a-e779-4e7e-9392-121a07d9cf1c")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/08. NullConditionalOperators/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | public static class Program
5 | {
6 | public static void Main()
7 | {
8 | var customers = GetCustomers();
9 |
10 | // Before:
11 | //// int? lengthOrNull = customers != null ? customers.Length : (int?)null;
12 | // After:
13 | int? lengthOrNull = customers?.Length; // null if customers is null
14 | Console.WriteLine("lengthOrNull.HasValue: {0}", lengthOrNull.HasValue);
15 |
16 | // Indexer access:
17 | var first = customers?[0]; // null if customers is null
18 |
19 | // Used together with the null coalescing operator ??:
20 | int lengthOrZero = customers?.Length ?? 0; // 0 if customers null
21 | Console.WriteLine("lengthOrZero: {0}", lengthOrZero);
22 |
23 | // Another example
24 | int? firstOrdersCount = customers?[0].Orders.Count();
25 | Console.WriteLine("firstOrdersCount.HasValue: {0}", firstOrdersCount.HasValue);
26 | Console.WriteLine("firstOrdersCount: {0}", firstOrdersCount);
27 |
28 | // Chaining of null checks before
29 | ////int? firstOrdersCount2 = (customers != null) ? (customers[0].Orders != null ? customers[0].Orders.Count() : (int?)null) : null;
30 | // Chaining of null checks after:
31 | int? firstOrdersCount3 = customers?[0].Orders?.Count();
32 | }
33 |
34 | private static Customer[] GetCustomers()
35 | {
36 | // new Customer[1] { new Customer() { Orders = new List { "order1", "order2" } } }
37 | return null;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/03. ExpressionBodiedFunctionMembers/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ExpressionBodiedFunctionMembers")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ExpressionBodiedFunctionMembers")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("280d6ce8-c003-4dfe-87e8-af6057f8c87f")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/RecordTypes/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RecordTypes
4 | {
5 | public static class Program
6 | {
7 | public static void Main()
8 | {
9 | var personRecord = new PersonRecord("John", "Doe", new DateTime(2021, 1, 1));
10 | // Read-only: personRecord.FirstName = "Niki";
11 |
12 | // ToString
13 | Console.WriteLine("personRecord.ToString(): " + personRecord.ToString());
14 |
15 | // Value equality
16 | var personRecord2 = new PersonRecord("John", "Doe", new DateTime(2021, 1, 1));
17 | Console.WriteLine("personRecord == personRecord2: " + (personRecord == personRecord2));
18 | Console.WriteLine("personRecord.Equals(personRecord2): " + personRecord.Equals(personRecord2));
19 |
20 | // Deconstruct
21 | (string firstName, string lastName, DateTime birthDate) = personRecord;
22 | Console.WriteLine($"deconstructed personRecord: ({firstName}, {lastName}, {birthDate.ToShortDateString()})");
23 |
24 | // Records with body
25 | var recordWithBody = new PersonRecordWithBody("John", "Doe");
26 | Console.WriteLine("recordWithBody.FullName: " + recordWithBody.FullName);
27 |
28 | // Student inherited from Person
29 | var student = new StudentRecord("John", "Doe", new DateTime(2021, 1, 1), "Sofia University");
30 | Console.WriteLine("student.FirstName: " + student.FirstName);
31 |
32 | // Mutation
33 | var newPerson = personRecord with { FirstName = "Niki", LastName = "Kostov" };
34 | Console.WriteLine("newPerson.ToString(): " + newPerson.ToString());
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/GlobalAndImplicitUsings/Program.cs:
--------------------------------------------------------------------------------
1 | // System is included by default because of enable in project file
2 | Console.WriteLine(Math.Cos(Math.PI));
3 |
4 | // System.Text.RegularExpressions is included in the project file
5 | Console.WriteLine(Regex.Match("Hello, 2022!", @"\d{4}").Value);
6 |
7 | // System.Net.Http is disabled in the project file
8 | System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
9 |
10 | // System.Numerics namespace is included in GlboalUsings.cs file
11 | Console.WriteLine(new Matrix3x2(1,2,3,4,5,6).GetDeterminant());
12 |
13 | /*
14 | The default namespaces:
15 |
16 | Microsoft.NET.Sdk
17 | System
18 | System.Collections.Generic
19 | System.IO
20 | System.Linq
21 | System.Net.Http
22 | System.Threading
23 | System.Threading.Tasks
24 |
25 | Microsoft.NET.Sdk.Web
26 | Microsoft.NET.Sdk namespaces
27 | System.Net.Http.Json
28 | Microsoft.AspNetCore.Builder
29 | Microsoft.AspNetCore.Hosting
30 | Microsoft.AspNetCore.Http
31 | Microsoft.AspNetCore.Routing
32 | Microsoft.Extensions.Configuration
33 | Microsoft.Extensions.DependencyInjection
34 | Microsoft.Extensions.Hosting
35 | Microsoft.Extensions.Logging
36 |
37 | Microsoft.NET.Sdk.Worker
38 | Microsoft.NET.Sdk namespaces
39 | Microsoft.Extensions.Configuration
40 | Microsoft.Extensions.DependencyInjection
41 | Microsoft.Extensions.Hosting
42 | Microsoft.Extensions.Logging
43 |
44 | Microsoft.NET.Sdk.WindowsDesktop (Windows Forms)
45 | Microsoft.NET.Sdk namespaces
46 | System.Drawing
47 | System.Windows.Forms
48 |
49 | Microsoft.NET.Sdk.WindowsDesktop (WPF)
50 | Microsoft.NET.Sdk namespaces
51 | Removed System.IO
52 | Removed System.Net.Http
53 | */
54 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/lib/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright JS Foundation and other contributors, https://js.foundation/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | All files located in the node_modules and external directories are
34 | externally maintained libraries used by this software which have their
35 | own licenses; we recommend you read them, as their terms may differ from
36 | the terms above.
37 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/10. AwaitInCatchFinally/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | public static class Program
5 | {
6 | public static void Main()
7 | {
8 | ReadData(@"..\..\Program.cs", @"Log.txt");
9 | ReadDataAsync(@"..\..\Program.cs", @"Log.txt");
10 | Console.ReadLine();
11 | }
12 |
13 | private static async void ReadDataAsync(string fileName, string logFileName)
14 | {
15 | // "using" statements omitted for simpler CIL code for the demo
16 | var input = new StreamReader(fileName);
17 | var log = new StreamWriter(logFileName);
18 | try
19 | {
20 | var line = await input.ReadLineAsync();
21 | Console.WriteLine("Line read");
22 | }
23 | catch (IOException ex)
24 | {
25 | await log.WriteLineAsync(ex.ToString());
26 | Console.WriteLine("Log written");
27 | }
28 | finally
29 | {
30 | await log.FlushAsync();
31 | Console.WriteLine("Log flushed");
32 | }
33 | }
34 |
35 | private static void ReadData(string fileName, string logFileName)
36 | {
37 | // "using" statements omitted for simpler CIL code for the demo
38 | var input = new StreamReader(fileName);
39 | var log = new StreamWriter(logFileName);
40 | try
41 | {
42 | var line = input.ReadLineAsync();
43 | Console.WriteLine("Line read");
44 | }
45 | catch (IOException ex)
46 | {
47 | log.WriteLine(ex.ToString());
48 | Console.WriteLine("Log written");
49 | }
50 | finally
51 | {
52 | log.Flush();
53 | Console.WriteLine("Log flushed");
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/08. Tuples/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | // Requires .NET Framework 4.7+
4 | public static class Program
5 | {
6 | public static void Main()
7 | {
8 | // Result from methods as var
9 | var names = SplitNames("Nikolay S Kostov");
10 | Console.WriteLine($"{nameof(names.firstName)} = {names.firstName}");
11 | Console.WriteLine($"{nameof(names.middleName)} = {names.middleName}");
12 | Console.WriteLine($"{nameof(names.lastName)} = {names.lastName}");
13 |
14 | // Declare 2 variables and discard middle name
15 | (string fn, _, var ln) = SplitNames("Moon Moon");
16 | Console.WriteLine($"{fn} {ln}");
17 |
18 | // Declare 1 variable with 3 fields
19 | (string fn, string mn, string ln) name = SplitNames("Moon Moon");
20 | Console.WriteLine($"{name.fn} {name.ln}");
21 |
22 | // Declare tuple
23 | var tupleDeclaration = (42, "String", new object());
24 | Console.WriteLine(tupleDeclaration.Item1);
25 | (int, string str, object) varTuple = (42, "String", new object());
26 | Console.WriteLine(varTuple.str);
27 | }
28 |
29 | public static (string firstName, string middleName, string lastName) SplitNames(string name)
30 | {
31 | var parts = name.Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries);
32 | switch (parts.Length)
33 | {
34 | case 1: return (parts[0], null, null);
35 | case 2: return (parts[0], null, parts[1]);
36 | case 3: return (parts[0], parts[1], parts[2]);
37 | default: throw new ArgumentException("Invalid string for name", nameof(name));
38 | }
39 | }
40 |
41 | public static (string title, string description) GetInfo(int id)
42 | => ("CLR", "Common Language Runtime");
43 | }
44 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/OtherImprovements/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.CompilerServices;
3 |
4 | namespace OtherImprovements
5 | {
6 | public static class Program
7 | {
8 | public static void Main()
9 | {
10 | // Extended property patterns
11 | var person = new Person();
12 | person.Address = new Address();
13 | person.Address.City = new City("Sofia");
14 | // C# 9: person is Person { Address: { City: { Name: "Sofia" } } }
15 | if (person is Person { Address.City.Name: "Sofia" })
16 | {
17 | Console.WriteLine("person is a Person class with city name of Sofia");
18 | }
19 |
20 | // Mix declarations and variables in deconstruction
21 | int a, b;
22 | (a, b) = (1, 2);
23 | (var c, var d) = (3, 4);
24 | (a, var e) = (1, 5); // Works in C# 10 onwards
25 | Console.WriteLine($"a = {a}; e = {e}");
26 |
27 | // Get expression from a method call
28 | CheckExpression(a > 5 && b < 6);
29 | CheckExpression(true);
30 | CheckExpression(true && false || true && !false);
31 | // ExampleOfEasierArgumentException(null);
32 | }
33 |
34 | private static void CheckExpression(
35 | bool condition,
36 | [CallerArgumentExpression("condition")] string message = null)
37 | {
38 | Console.WriteLine($"Condition: {message}");
39 | }
40 |
41 | private static void ExampleOfEasierArgumentException(Person person)
42 | {
43 | // No need to pass in the parameter name here
44 | ArgumentNullException.ThrowIfNull(person);
45 | // Before C# 10: throw new ArgumentNullException(nameof(person));
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/06. PatternMatching/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public static class Program
4 | {
5 | public static void Main()
6 | {
7 | PrintStars(10);
8 |
9 | object obj = TheUltimateAnswer();
10 | if (obj is int i || (obj is string s && int.TryParse(s, out i)))
11 | {
12 | Console.WriteLine(i);
13 | }
14 |
15 | SwitchStatementsWithPatterns(new Rectangle { Width = 2, Height = 2 });
16 | }
17 |
18 | public static void PrintStars(object obj)
19 | {
20 | if (obj is null) // constant pattern "null"
21 | {
22 | return;
23 | }
24 |
25 | if (obj is string _) // discarding the variable
26 | {
27 | Console.WriteLine($"{obj} is string!");
28 | }
29 |
30 | if (!(obj is int i)) // type pattern "int i"
31 | {
32 | return;
33 | }
34 |
35 | Console.WriteLine(new string('*', i));
36 | }
37 |
38 | private static void SwitchStatementsWithPatterns(object shape)
39 | {
40 | switch (shape)
41 | {
42 | case Circle c:
43 | Console.WriteLine($"circle with radius {c.Radius}");
44 | break;
45 | case Rectangle s when s.Width == s.Height:
46 | Console.WriteLine($"{s.Width} x {s.Height} square");
47 | break;
48 | case Rectangle r:
49 | Console.WriteLine($"{r.Width} x {r.Height} rectangle");
50 | break;
51 | case string _: // discarding the variable
52 | Console.WriteLine($"{shape} is string");
53 | break;
54 | case null:
55 | throw new ArgumentNullException(nameof(shape));
56 | default:
57 | Console.WriteLine("");
58 | break;
59 | }
60 | }
61 |
62 | private static object TheUltimateAnswer()
63 | {
64 | return "42";
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/01. Roslyn/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/Pages/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | @ViewData["Title"] - TopLevelWebApp
7 |
8 |
9 |
10 |
11 |
12 |
33 |
34 |
35 | @RenderBody()
36 |
37 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 | @await RenderSectionAsync("Scripts", required: false)
50 |
51 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/05. OutVariables/05. OutVariables.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {9B7EB2A8-DF89-4D42-A901-001167E4D9C4}
8 | Exe
9 | OutVariables
10 | 05.OutVariables
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/03. LocalFunctions/03. LocalFunctions.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D0E1002F-7E19-4228-8DEC-77862480B9B9}
8 | Exe
9 | LocalFunctions
10 | 03.LocalFunctions
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/09. Deconstruction/09. Deconstruction.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {2CE2F0B2-A5E2-4BB4-98C6-C17B75B3BAFA}
8 | Exe
9 | Deconstruction
10 | 09.Deconstruction
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/08. Tuples/08. Tuples.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {C0282DC3-5C88-42D1-A1C9-97D8AED9EB1D}
8 | Exe
9 | Tuples
10 | 08.Tuples
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/07. ThrowExpressions/07. ThrowExpressions.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {E99F18F6-A7D6-400E-B6F5-4B476CA0E6E7}
8 | Exe
9 | ThrowExpressions
10 | 07.ThrowExpressions
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/04. RefReturnsAndLocals/04. RefReturnsAndLocals.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {A936631C-1D0C-45AD-AD30-B92E29EAC95B}
8 | Exe
9 | RefReturnsAndLocals
10 | 04.RefReturnsAndLocals
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/02. NumberLiteralsImprovements/02. NumberLiteralsImprovements.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {79C02EA4-CBC9-4758-BD04-2FB4FA4415C2}
8 | Exe
9 | NumberLiteralsImprovements
10 | 02.NumberLiteralsImprovements
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/06. PatternMatching/06. PatternMatching.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {EB37DF9D-605C-49CA-9393-41C241F00C46}
8 | Exe
9 | PatternMatching
10 | 06.PatternMatching
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/01. MoreExpressionBodiedMembers/01. MoreExpressionBodiedMembers.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {743B7F47-BFBA-4FF7-9FB7-8C441E645142}
8 | Exe
9 | MoreExpressionBodiedMembers
10 | 01.MoreExpressionBodiedMembers
11 | v4.7
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/04. UsingStatic/04. UsingStatic.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {1B76D878-2F96-4ADC-BFFD-D4FB743E6A86}
8 | Exe
9 | Properties
10 | UsingStatic
11 | 04.UsingStatic
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
58 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/09. IndexInitializers/09. IndexInitializers.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {ABED5388-EF91-449B-8B0F-397C504BFBE7}
8 | Exe
9 | Properties
10 | IndexInitializers
11 | 09.IndexInitializers
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
58 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/10. AwaitInCatchFinally/10. AwaitInCatchFinally.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {CC4E5072-1B81-4FAA-A1EB-11164DF5A38C}
8 | Exe
9 | Properties
10 | AwaitInCatchFinally
11 | 10.AwaitInCatchFinally
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
58 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/05. NameofExpressions/05. NameofExpressions.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {3B70B428-F759-494E-B033-A7FCAEB06788}
8 | Exe
9 | Properties
10 | NameofExpressions
11 | 05.NameofExpressions
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
59 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/08. NullConditionalOperators/08. NullConditionalOperators.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {8E14046A-E779-4E7E-9392-121A07D9CF1C}
8 | Exe
9 | Properties
10 | NullConditionalOperators
11 | 08.NullConditionalOperators
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
59 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/07. ExceptionFilters/07. ExceptionFilters.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {FB7A5C8F-39DD-41DA-9DA0-F27DE2BF0604}
8 | Exe
9 | Properties
10 | ExceptionFilters
11 | 07.ExceptionFilters
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
60 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/02. AutoPropertyEnhancements/02. AutoPropertyEnhancements.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {9B820676-7425-4F37-8B46-27BC9932D52B}
8 | Exe
9 | Properties
10 | AutoPropertyEnhancements
11 | 02.AutoPropertyEnhancements
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
60 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/06. StringInterpolation/06. StringInterpolation.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {882725AD-8AEB-4F17-9F08-DA28B78547E7}
8 | Exe
9 | Properties
10 | StringInterpolation
11 | 06.StringInterpolation
12 | v4.5
13 | 512
14 | true
15 |
16 |
17 |
18 | AnyCPU
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
61 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/03. ExpressionBodiedFunctionMembers/03. ExpressionBodiedFunctionMembers.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {280D6CE8-C003-4DFE-87E8-AF6057F8C87F}
8 | Exe
9 | Properties
10 | ExpressionBodiedFunctionMembers
11 | 03.ExpressionBodiedFunctionMembers
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
60 |
--------------------------------------------------------------------------------
/CSharp-10-New-Features/RecordStructs/PersonRecordDecompiled.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace RecordStructs
6 | {
7 | public struct PersonRecordDecompiled
8 | {
9 | public string FirstName { get; set; } // { get; init; } when readonly
10 |
11 | public string LastName { get; set; } // { get; init; } when readonly
12 |
13 | public DateTime BirthDate { get; set; } // { get; init; } when readonly
14 |
15 | public PersonRecordDecompiled(string FirstName, string LastName, DateTime BirthDate)
16 | {
17 | this.FirstName = FirstName;
18 | this.LastName = LastName;
19 | this.BirthDate = BirthDate;
20 | }
21 |
22 | public override readonly string ToString()
23 | {
24 | StringBuilder stringBuilder = new StringBuilder();
25 | stringBuilder.Append("PersonRecord");
26 | stringBuilder.Append(" { ");
27 | if (PrintMembers(stringBuilder))
28 | {
29 | stringBuilder.Append(' ');
30 | }
31 | stringBuilder.Append('}');
32 | return stringBuilder.ToString();
33 | }
34 |
35 | private readonly bool PrintMembers(StringBuilder builder)
36 | {
37 | builder.Append("FirstName = ");
38 | builder.Append((object?)FirstName);
39 | builder.Append(", LastName = ");
40 | builder.Append((object?)LastName);
41 | builder.Append(", BirthDate = ");
42 | builder.Append(BirthDate.ToString());
43 | return true;
44 | }
45 |
46 | public static bool operator !=(PersonRecordDecompiled left, PersonRecordDecompiled right)
47 | {
48 | return !(left == right);
49 | }
50 |
51 | public static bool operator ==(PersonRecordDecompiled left, PersonRecordDecompiled right)
52 | {
53 | return left.Equals(right);
54 | }
55 |
56 | public override readonly int GetHashCode()
57 | {
58 | return (EqualityComparer.Default.GetHashCode(FirstName) * -1521134295 + EqualityComparer.Default.GetHashCode(LastName)) * -1521134295 + EqualityComparer.Default.GetHashCode(BirthDate);
59 | }
60 |
61 | #pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
62 | public override readonly bool Equals(object obj)
63 | #pragma warning restore CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
64 | {
65 | return obj is PersonRecord && Equals((PersonRecord)obj);
66 | }
67 |
68 | public readonly bool Equals(PersonRecord other)
69 | {
70 | return EqualityComparer.Default.Equals(FirstName, other.FirstName) && EqualityComparer.Default.Equals(LastName, other.LastName) && EqualityComparer.Default.Equals(BirthDate, other.BirthDate);
71 | }
72 |
73 | public readonly void Deconstruct(out string FirstName, out string LastName, out DateTime BirthDate)
74 | {
75 | FirstName = this.FirstName;
76 | LastName = this.LastName;
77 | BirthDate = this.BirthDate;
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/Settings.StyleCop:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | True
6 |
7 |
8 |
9 |
10 | 2000
11 |
12 | Json
13 | xaml
14 | ciphertext
15 | Rijndael
16 | unenroll
17 | unenrollment
18 | bgcoder
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | False
27 |
28 |
29 |
30 |
31 | False
32 |
33 |
34 |
35 |
36 | False
37 |
38 |
39 |
40 |
41 | False
42 |
43 |
44 |
45 |
46 | False
47 |
48 |
49 |
50 |
51 | False
52 |
53 |
54 |
55 |
56 | False
57 |
58 |
59 |
60 |
61 | True
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | at
71 | db
72 | or
73 | up
74 | iq
75 | it
76 | un
77 | bg
78 | ip
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/Settings.StyleCop:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | True
6 |
7 |
8 |
9 |
10 | 2000
11 |
12 | Json
13 | xaml
14 | ciphertext
15 | Rijndael
16 | unenroll
17 | unenrollment
18 | bgcoder
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | False
27 |
28 |
29 |
30 |
31 | False
32 |
33 |
34 |
35 |
36 | False
37 |
38 |
39 |
40 |
41 | False
42 |
43 |
44 |
45 |
46 | False
47 |
48 |
49 |
50 |
51 | False
52 |
53 |
54 |
55 |
56 | False
57 |
58 |
59 |
60 |
61 | True
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | at
71 | db
72 | or
73 | up
74 | iq
75 | it
76 | un
77 | bg
78 | ip
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/RecordTypes/PersonRecordDecompiled.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace RecordTypes
6 | {
7 | public class PersonRecordDecompiled : IEquatable
8 | {
9 | protected virtual Type EqualityContract
10 | {
11 | get
12 | {
13 | return typeof(PersonRecordDecompiled);
14 | }
15 | }
16 |
17 | public string FirstName { get; init; }
18 |
19 | public string LastName { get; init; }
20 |
21 | public DateTime BirthDate { get; init; }
22 |
23 | public PersonRecordDecompiled(string FirstName, string LastName, DateTime BirthDate)
24 | {
25 | this.FirstName = FirstName;
26 | this.LastName = LastName;
27 | this.BirthDate = BirthDate;
28 | }
29 |
30 | public override string ToString()
31 | {
32 | StringBuilder stringBuilder = new StringBuilder();
33 | stringBuilder.Append("Person");
34 | stringBuilder.Append(" { ");
35 | if (PrintMembers(stringBuilder))
36 | {
37 | stringBuilder.Append(' ');
38 | }
39 | stringBuilder.Append('}');
40 | return stringBuilder.ToString();
41 | }
42 |
43 | protected virtual bool PrintMembers(StringBuilder builder)
44 | {
45 | builder.Append("FirstName = ");
46 | builder.Append((object)FirstName);
47 | builder.Append(", LastName = ");
48 | builder.Append((object)LastName);
49 | builder.Append(", BirthDate = ");
50 | builder.Append(BirthDate.ToString());
51 | return true;
52 | }
53 |
54 | public static bool operator !=(PersonRecordDecompiled left, PersonRecordDecompiled right)
55 | {
56 | return !(left == right);
57 | }
58 |
59 | public static bool operator ==(PersonRecordDecompiled left, PersonRecordDecompiled right)
60 | {
61 | return (object)left == right || (left?.Equals(right) ?? false);
62 | }
63 |
64 | public override int GetHashCode()
65 | {
66 | return ((EqualityComparer.Default.GetHashCode(EqualityContract) * -1521134295 + EqualityComparer.Default.GetHashCode(FirstName)) * -1521134295 + EqualityComparer.Default.GetHashCode(LastName)) * -1521134295 + EqualityComparer.Default.GetHashCode(BirthDate);
67 | }
68 |
69 | public override bool Equals(object obj)
70 | {
71 | return Equals(obj as PersonRecordDecompiled);
72 | }
73 |
74 | public virtual bool Equals(PersonRecordDecompiled other)
75 | {
76 | return (object)this == other || ((object)other != null && EqualityContract == other!.EqualityContract && EqualityComparer.Default.Equals(FirstName, other!.FirstName) && EqualityComparer.Default.Equals(LastName, other!.LastName) && EqualityComparer.Default.Equals(BirthDate, other!.BirthDate));
77 | }
78 |
79 | protected PersonRecordDecompiled(PersonRecordDecompiled original)
80 | {
81 | FirstName = original.FirstName;
82 | LastName = original.LastName;
83 | BirthDate = original.BirthDate;
84 | }
85 |
86 | public void Deconstruct(out string FirstName, out string LastName, out DateTime BirthDate)
87 | {
88 | FirstName = this.FirstName;
89 | LastName = this.LastName;
90 | BirthDate = this.BirthDate;
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/01. Roslyn/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
3 | * Copyright 2011-2021 The Bootstrap Authors
4 | * Copyright 2011-2021 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
3 | * Copyright 2011-2021 The Bootstrap Authors
4 | * Copyright 2011-2021 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-right:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-right:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:right}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:right;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:right}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}[type=email],[type=number],[type=tel],[type=url]{direction:ltr}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.rtl.min.css.map */
--------------------------------------------------------------------------------
/CSharp-10-New-Features/CSharp-10-New-Features.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31912.275
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RecordStructs", "RecordStructs\RecordStructs.csproj", "{EE6D3FB8-CCFE-406F-8E94-3C8577BDC75C}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GlobalAndImplicitUsings", "GlobalAndImplicitUsings\GlobalAndImplicitUsings.csproj", "{73C8B8A6-4A79-4918-AF47-F678E0AA9D25}"
9 | EndProject
10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileScopedNamespaces", "FileScopedNamespaces\FileScopedNamespaces.csproj", "{997A03C7-CE84-4E6C-969C-1C7CB935AE60}"
11 | EndProject
12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LambdaExpressionsImprovements", "LambdaExpressionsImprovements\LambdaExpressionsImprovements.csproj", "{8AB4F26D-EB11-422E-B69D-A415B236A59E}"
13 | EndProject
14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImprovementsToStructs", "ImprovementsToStructs\ImprovementsToStructs.csproj", "{B679AD79-BC34-4C8F-B056-BFB95AB34672}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OtherImprovements", "OtherImprovements\OtherImprovements.csproj", "{2939BC20-8067-4A8F-B018-7E8D2D4C8CBC}"
17 | EndProject
18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InterpolatedStringImprovements", "InterpolatedStringImprovements\InterpolatedStringImprovements.csproj", "{F6DC0A1E-0C6D-4F29-9171-B8788C0EDD46}"
19 | EndProject
20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticAbstractInInterfaces", "StaticAbstractInInterfaces\StaticAbstractInInterfaces.csproj", "{B38FE320-78F7-441A-B95F-8435D606F4BE}"
21 | EndProject
22 | Global
23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
24 | Debug|Any CPU = Debug|Any CPU
25 | Release|Any CPU = Release|Any CPU
26 | EndGlobalSection
27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
28 | {EE6D3FB8-CCFE-406F-8E94-3C8577BDC75C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {EE6D3FB8-CCFE-406F-8E94-3C8577BDC75C}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {EE6D3FB8-CCFE-406F-8E94-3C8577BDC75C}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {EE6D3FB8-CCFE-406F-8E94-3C8577BDC75C}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {73C8B8A6-4A79-4918-AF47-F678E0AA9D25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {73C8B8A6-4A79-4918-AF47-F678E0AA9D25}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {73C8B8A6-4A79-4918-AF47-F678E0AA9D25}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {73C8B8A6-4A79-4918-AF47-F678E0AA9D25}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {997A03C7-CE84-4E6C-969C-1C7CB935AE60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {997A03C7-CE84-4E6C-969C-1C7CB935AE60}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {997A03C7-CE84-4E6C-969C-1C7CB935AE60}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {997A03C7-CE84-4E6C-969C-1C7CB935AE60}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {8AB4F26D-EB11-422E-B69D-A415B236A59E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {8AB4F26D-EB11-422E-B69D-A415B236A59E}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {8AB4F26D-EB11-422E-B69D-A415B236A59E}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {8AB4F26D-EB11-422E-B69D-A415B236A59E}.Release|Any CPU.Build.0 = Release|Any CPU
44 | {B679AD79-BC34-4C8F-B056-BFB95AB34672}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {B679AD79-BC34-4C8F-B056-BFB95AB34672}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {B679AD79-BC34-4C8F-B056-BFB95AB34672}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {B679AD79-BC34-4C8F-B056-BFB95AB34672}.Release|Any CPU.Build.0 = Release|Any CPU
48 | {2939BC20-8067-4A8F-B018-7E8D2D4C8CBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49 | {2939BC20-8067-4A8F-B018-7E8D2D4C8CBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
50 | {2939BC20-8067-4A8F-B018-7E8D2D4C8CBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 | {2939BC20-8067-4A8F-B018-7E8D2D4C8CBC}.Release|Any CPU.Build.0 = Release|Any CPU
52 | {F6DC0A1E-0C6D-4F29-9171-B8788C0EDD46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53 | {F6DC0A1E-0C6D-4F29-9171-B8788C0EDD46}.Debug|Any CPU.Build.0 = Debug|Any CPU
54 | {F6DC0A1E-0C6D-4F29-9171-B8788C0EDD46}.Release|Any CPU.ActiveCfg = Release|Any CPU
55 | {F6DC0A1E-0C6D-4F29-9171-B8788C0EDD46}.Release|Any CPU.Build.0 = Release|Any CPU
56 | {B38FE320-78F7-441A-B95F-8435D606F4BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 | {B38FE320-78F7-441A-B95F-8435D606F4BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 | {B38FE320-78F7-441A-B95F-8435D606F4BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
59 | {B38FE320-78F7-441A-B95F-8435D606F4BE}.Release|Any CPU.Build.0 = Release|Any CPU
60 | EndGlobalSection
61 | GlobalSection(SolutionProperties) = preSolution
62 | HideSolutionNode = FALSE
63 | EndGlobalSection
64 | GlobalSection(ExtensibilityGlobals) = postSolution
65 | SolutionGuid = {A189BA84-FC2F-48BF-B109-B9D20BE6D2DE}
66 | EndGlobalSection
67 | EndGlobal
68 |
--------------------------------------------------------------------------------
/CSharp-7.0-New-Features/CSharp-7-New-Features.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26403.7
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01. MoreExpressionBodiedMembers", "01. MoreExpressionBodiedMembers\01. MoreExpressionBodiedMembers.csproj", "{743B7F47-BFBA-4FF7-9FB7-8C441E645142}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02. NumberLiteralsImprovements", "02. NumberLiteralsImprovements\02. NumberLiteralsImprovements.csproj", "{79C02EA4-CBC9-4758-BD04-2FB4FA4415C2}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03. LocalFunctions", "03. LocalFunctions\03. LocalFunctions.csproj", "{D0E1002F-7E19-4228-8DEC-77862480B9B9}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04. RefReturnsAndLocals", "04. RefReturnsAndLocals\04. RefReturnsAndLocals.csproj", "{A936631C-1D0C-45AD-AD30-B92E29EAC95B}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05. OutVariables", "05. OutVariables\05. OutVariables.csproj", "{9B7EB2A8-DF89-4D42-A901-001167E4D9C4}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "06. PatternMatching", "06. PatternMatching\06. PatternMatching.csproj", "{EB37DF9D-605C-49CA-9393-41C241F00C46}"
17 | EndProject
18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "07. ThrowExpressions", "07. ThrowExpressions\07. ThrowExpressions.csproj", "{E99F18F6-A7D6-400E-B6F5-4B476CA0E6E7}"
19 | EndProject
20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "08. Tuples", "08. Tuples\08. Tuples.csproj", "{C0282DC3-5C88-42D1-A1C9-97D8AED9EB1D}"
21 | EndProject
22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09. Deconstruction", "09. Deconstruction\09. Deconstruction.csproj", "{2CE2F0B2-A5E2-4BB4-98C6-C17B75B3BAFA}"
23 | EndProject
24 | Global
25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
26 | Debug|Any CPU = Debug|Any CPU
27 | Release|Any CPU = Release|Any CPU
28 | EndGlobalSection
29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
30 | {743B7F47-BFBA-4FF7-9FB7-8C441E645142}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31 | {743B7F47-BFBA-4FF7-9FB7-8C441E645142}.Debug|Any CPU.Build.0 = Debug|Any CPU
32 | {743B7F47-BFBA-4FF7-9FB7-8C441E645142}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {743B7F47-BFBA-4FF7-9FB7-8C441E645142}.Release|Any CPU.Build.0 = Release|Any CPU
34 | {79C02EA4-CBC9-4758-BD04-2FB4FA4415C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35 | {79C02EA4-CBC9-4758-BD04-2FB4FA4415C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
36 | {79C02EA4-CBC9-4758-BD04-2FB4FA4415C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
37 | {79C02EA4-CBC9-4758-BD04-2FB4FA4415C2}.Release|Any CPU.Build.0 = Release|Any CPU
38 | {D0E1002F-7E19-4228-8DEC-77862480B9B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39 | {D0E1002F-7E19-4228-8DEC-77862480B9B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
40 | {D0E1002F-7E19-4228-8DEC-77862480B9B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
41 | {D0E1002F-7E19-4228-8DEC-77862480B9B9}.Release|Any CPU.Build.0 = Release|Any CPU
42 | {A936631C-1D0C-45AD-AD30-B92E29EAC95B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43 | {A936631C-1D0C-45AD-AD30-B92E29EAC95B}.Debug|Any CPU.Build.0 = Debug|Any CPU
44 | {A936631C-1D0C-45AD-AD30-B92E29EAC95B}.Release|Any CPU.ActiveCfg = Release|Any CPU
45 | {A936631C-1D0C-45AD-AD30-B92E29EAC95B}.Release|Any CPU.Build.0 = Release|Any CPU
46 | {9B7EB2A8-DF89-4D42-A901-001167E4D9C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 | {9B7EB2A8-DF89-4D42-A901-001167E4D9C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 | {9B7EB2A8-DF89-4D42-A901-001167E4D9C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
49 | {9B7EB2A8-DF89-4D42-A901-001167E4D9C4}.Release|Any CPU.Build.0 = Release|Any CPU
50 | {EB37DF9D-605C-49CA-9393-41C241F00C46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51 | {EB37DF9D-605C-49CA-9393-41C241F00C46}.Debug|Any CPU.Build.0 = Debug|Any CPU
52 | {EB37DF9D-605C-49CA-9393-41C241F00C46}.Release|Any CPU.ActiveCfg = Release|Any CPU
53 | {EB37DF9D-605C-49CA-9393-41C241F00C46}.Release|Any CPU.Build.0 = Release|Any CPU
54 | {E99F18F6-A7D6-400E-B6F5-4B476CA0E6E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55 | {E99F18F6-A7D6-400E-B6F5-4B476CA0E6E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
56 | {E99F18F6-A7D6-400E-B6F5-4B476CA0E6E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
57 | {E99F18F6-A7D6-400E-B6F5-4B476CA0E6E7}.Release|Any CPU.Build.0 = Release|Any CPU
58 | {C0282DC3-5C88-42D1-A1C9-97D8AED9EB1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59 | {C0282DC3-5C88-42D1-A1C9-97D8AED9EB1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
60 | {C0282DC3-5C88-42D1-A1C9-97D8AED9EB1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
61 | {C0282DC3-5C88-42D1-A1C9-97D8AED9EB1D}.Release|Any CPU.Build.0 = Release|Any CPU
62 | {2CE2F0B2-A5E2-4BB4-98C6-C17B75B3BAFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63 | {2CE2F0B2-A5E2-4BB4-98C6-C17B75B3BAFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
64 | {2CE2F0B2-A5E2-4BB4-98C6-C17B75B3BAFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
65 | {2CE2F0B2-A5E2-4BB4-98C6-C17B75B3BAFA}.Release|Any CPU.Build.0 = Release|Any CPU
66 | EndGlobalSection
67 | GlobalSection(SolutionProperties) = preSolution
68 | HideSolutionNode = FALSE
69 | EndGlobalSection
70 | EndGlobal
71 |
--------------------------------------------------------------------------------
/CSharp-9.0-New-Features/TopLevelWebApp/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js:
--------------------------------------------------------------------------------
1 | // Unobtrusive validation support library for jQuery and jQuery Validate
2 | // Copyright (c) .NET Foundation. All rights reserved.
3 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
4 | // @version v3.2.11
5 | !function(a){"function"==typeof define&&define.amd?define("jquery.validate.unobtrusive",["jquery-validation"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery-validation")):jQuery.validator.unobtrusive=a(jQuery)}(function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a(" ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function u(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=f.unobtrusive.options||{},u=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),u("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),u("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),u("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var m,f=a.validator,v="unobtrusiveValidation";return f.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=u(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){f.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=u(this);a&&a.attachValidation()})}},m=f.unobtrusive.adapters,m.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},m.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},m.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},m.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},f.addMethod("__dummy__",function(a,e,n){return!0}),f.addMethod("regex",function(a,e,n){var t;return!!this.optional(e)||(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),f.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),f.methods.extension?(m.addSingleVal("accept","mimtype"),m.addSingleVal("extension","extension")):m.addSingleVal("extension","extension","accept"),m.addSingleVal("regex","pattern"),m.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),m.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),m.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),m.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),m.add("required",function(a){"INPUT"===a.element.tagName.toUpperCase()&&"CHECKBOX"===a.element.type.toUpperCase()||e(a,"required",!0)}),m.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),m.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),m.add("fileextensions",["extensions"],function(a){e(a,"extension",a.params.extensions)}),a(function(){f.unobtrusive.parse(document)}),f.unobtrusive});
6 |
--------------------------------------------------------------------------------
/CSharp-6.0-New-Features/CSharp-6-New-Features.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03. ExpressionBodiedFunctionMembers", "03. ExpressionBodiedFunctionMembers\03. ExpressionBodiedFunctionMembers.csproj", "{280D6CE8-C003-4DFE-87E8-AF6057F8C87F}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04. UsingStatic", "04. UsingStatic\04. UsingStatic.csproj", "{1B76D878-2F96-4ADC-BFFD-D4FB743E6A86}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "08. NullConditionalOperators", "08. NullConditionalOperators\08. NullConditionalOperators.csproj", "{8E14046A-E779-4E7E-9392-121A07D9CF1C}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09. IndexInitializers", "09. IndexInitializers\09. IndexInitializers.csproj", "{ABED5388-EF91-449B-8B0F-397C504BFBE7}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10. AwaitInCatchFinally", "10. AwaitInCatchFinally\10. AwaitInCatchFinally.csproj", "{CC4E5072-1B81-4FAA-A1EB-11164DF5A38C}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02. AutoPropertyEnhancements", "02. AutoPropertyEnhancements\02. AutoPropertyEnhancements.csproj", "{9B820676-7425-4F37-8B46-27BC9932D52B}"
17 | EndProject
18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01. Roslyn", "01. Roslyn\01. Roslyn.csproj", "{88696B3E-3BD0-45B7-B090-0E32A40CFBB1}"
19 | EndProject
20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05. NameofExpressions", "05. NameofExpressions\05. NameofExpressions.csproj", "{3B70B428-F759-494E-B033-A7FCAEB06788}"
21 | EndProject
22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "06. StringInterpolation", "06. StringInterpolation\06. StringInterpolation.csproj", "{882725AD-8AEB-4F17-9F08-DA28B78547E7}"
23 | EndProject
24 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "07. ExceptionFilters", "07. ExceptionFilters\07. ExceptionFilters.csproj", "{FB7A5C8F-39DD-41DA-9DA0-F27DE2BF0604}"
25 | EndProject
26 | Global
27 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
28 | Debug|Any CPU = Debug|Any CPU
29 | Release|Any CPU = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
32 | {280D6CE8-C003-4DFE-87E8-AF6057F8C87F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {280D6CE8-C003-4DFE-87E8-AF6057F8C87F}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {280D6CE8-C003-4DFE-87E8-AF6057F8C87F}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {280D6CE8-C003-4DFE-87E8-AF6057F8C87F}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {1B76D878-2F96-4ADC-BFFD-D4FB743E6A86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {1B76D878-2F96-4ADC-BFFD-D4FB743E6A86}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {1B76D878-2F96-4ADC-BFFD-D4FB743E6A86}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {1B76D878-2F96-4ADC-BFFD-D4FB743E6A86}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {8E14046A-E779-4E7E-9392-121A07D9CF1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {8E14046A-E779-4E7E-9392-121A07D9CF1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {8E14046A-E779-4E7E-9392-121A07D9CF1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {8E14046A-E779-4E7E-9392-121A07D9CF1C}.Release|Any CPU.Build.0 = Release|Any CPU
44 | {ABED5388-EF91-449B-8B0F-397C504BFBE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {ABED5388-EF91-449B-8B0F-397C504BFBE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {ABED5388-EF91-449B-8B0F-397C504BFBE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {ABED5388-EF91-449B-8B0F-397C504BFBE7}.Release|Any CPU.Build.0 = Release|Any CPU
48 | {CC4E5072-1B81-4FAA-A1EB-11164DF5A38C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49 | {CC4E5072-1B81-4FAA-A1EB-11164DF5A38C}.Debug|Any CPU.Build.0 = Debug|Any CPU
50 | {CC4E5072-1B81-4FAA-A1EB-11164DF5A38C}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 | {CC4E5072-1B81-4FAA-A1EB-11164DF5A38C}.Release|Any CPU.Build.0 = Release|Any CPU
52 | {9B820676-7425-4F37-8B46-27BC9932D52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53 | {9B820676-7425-4F37-8B46-27BC9932D52B}.Debug|Any CPU.Build.0 = Debug|Any CPU
54 | {9B820676-7425-4F37-8B46-27BC9932D52B}.Release|Any CPU.ActiveCfg = Release|Any CPU
55 | {9B820676-7425-4F37-8B46-27BC9932D52B}.Release|Any CPU.Build.0 = Release|Any CPU
56 | {88696B3E-3BD0-45B7-B090-0E32A40CFBB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 | {88696B3E-3BD0-45B7-B090-0E32A40CFBB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 | {88696B3E-3BD0-45B7-B090-0E32A40CFBB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
59 | {88696B3E-3BD0-45B7-B090-0E32A40CFBB1}.Release|Any CPU.Build.0 = Release|Any CPU
60 | {3B70B428-F759-494E-B033-A7FCAEB06788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61 | {3B70B428-F759-494E-B033-A7FCAEB06788}.Debug|Any CPU.Build.0 = Debug|Any CPU
62 | {3B70B428-F759-494E-B033-A7FCAEB06788}.Release|Any CPU.ActiveCfg = Release|Any CPU
63 | {3B70B428-F759-494E-B033-A7FCAEB06788}.Release|Any CPU.Build.0 = Release|Any CPU
64 | {882725AD-8AEB-4F17-9F08-DA28B78547E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65 | {882725AD-8AEB-4F17-9F08-DA28B78547E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
66 | {882725AD-8AEB-4F17-9F08-DA28B78547E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
67 | {882725AD-8AEB-4F17-9F08-DA28B78547E7}.Release|Any CPU.Build.0 = Release|Any CPU
68 | {FB7A5C8F-39DD-41DA-9DA0-F27DE2BF0604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69 | {FB7A5C8F-39DD-41DA-9DA0-F27DE2BF0604}.Debug|Any CPU.Build.0 = Debug|Any CPU
70 | {FB7A5C8F-39DD-41DA-9DA0-F27DE2BF0604}.Release|Any CPU.ActiveCfg = Release|Any CPU
71 | {FB7A5C8F-39DD-41DA-9DA0-F27DE2BF0604}.Release|Any CPU.Build.0 = Release|Any CPU
72 | EndGlobalSection
73 | GlobalSection(SolutionProperties) = preSolution
74 | HideSolutionNode = FALSE
75 | EndGlobalSection
76 | EndGlobal
77 |
--------------------------------------------------------------------------------