New C-Sharp 12 preview features in Net8
programming

New C-Sharp 12 preview features in Net8

7/27/2023
The .NET Framework is a software framework developed by Microsoft. It was Initially released on 13 February 2002. Dot NET has been Microsoft's primary developer platform since 2000, and it continues to thrive. The .NET Framework provides developers with tools and guidance for developing sofware and applications
  • Easy access to inline arrays will allow libraries to use them in more places without effort on your part.
  • This preview debuts an experimental feature called interceptors that allow generators to reroute code, such as to provide context specific optimization.
  • Finally, nameof is enhanced to work in more places.
public class Student(int id, string name, IEnumerable<decimal> grades)
{
    public Student(int id, string name) : this(id, name, Enumerable.Empty<decimal>()) { }
    public int Id => id;
    public string Name { get; set; } = name.Trim();
    public decimal GPA => grades.Any() ? grades.Average() : 4.0m;
}

read more here
.NET 8 Preview 6 continue the evolution of C# 12.