Here we are going to learn to use C## 9.0 feature record type with ASP.NET Core 5.0. Let’s first understand a few keywords.

What is C## 9.0?

C## 9.0 is the latest version of the C## language and it is supported on .NET 5.

Features

  • Records
  • Init only setters
  • Top-level statements
  • Pattern matching enhancements
  • Fit and finish features
  • Support for code generators
  • etc

What is ASP.NET Core?

ASP.NET Core is a cross-platform, free and open-source web framework.

What is ASP.NET Core 5.0?

ASP.NET Core is the latest version of the ASP.NET Core framework and it was released in 2020. and it Supports C## 9.0.

Features

  • Model binding and validation with C## 9 record types
  • Improvements to DynamicRouteValueTransformer
  • OpenAPI Specification on by default
  • Azure API Management Import
  • Better launch experience for web API projects
  • Blazor Performance improvements
  • New InputFile component
  • New InputRadio and InputRadioGroup components

The C## 9 record type is used for data transfer objects where immutable is valuable.

We can transfer data back and forth from an ASP.NET Core Web API.

I have created a couple of record types to transfer data and that represents adding a new student and getting a student from the web API.

#c# 9 #asp.net

ASP.NET Core 5 With Web API And C# 9 Record Type
1.25 GEEK