Microsoft Build 2020
03 Jun 2020
C# 9.0 - MSBuild 2020 - Exciting new features coming soon in C# 9.0, as part of .NET 5.
- No need to write a class just to write a
Main()function anymore. You can start writing executable code in your
.csfile just like it is a scripting language. You can also define functions within such files, and mark them as static. This means that these functions are available just within the file.
- Class properties had getters and setters; now there’s a new
initsetting that allows the property to be set only during initialization
- Add a
dataprefix to a class definition to start treating it as a value (“record”). This allows non destructive mutation. This helps add support for immutable data structures. The Equal() function performs shallow comparison of properties, and the ReferenceEqual() function performs a check based on object identity.
- Record properties are public, init-only auto properties by default
- Shorthand syntax to declare simple records as constructor parameters
- Pattern matching improvements
newdetermines class name using context
- Function parameters can now specify a
!at the end of the name to force an automatic
Modern Web with Blazor Web Assembly - Blazor is part of ASP.NET core. This is a good that demo focuses on the Web Assembly portion of Blazor, where you can write a Single Page browser Application using C#. It also comes with a good debugging experience.
What every VS Code user should know about Github - Useful features for Github users to do almost everything - create, review and merge PRs - without leaving VS Code.