C# 14 · Records, classes and pattern matching

Provide a default interface method

An interface can include an implementation that classes may override.

public interface ILogger
{
    void Log(string message);
    void Info(string message) => Log($"INFO: {message}");
}

Official C# 14 documentation

More records, classes and pattern matching commands

All records, classes and pattern matching commands · C# 14 cheatsheet

Was this page helpful?