primary constructor
Constructor parameters written right after the type name.
A primary constructor (C# 12 for classes and structs) declares parameters on the type declaration that are in scope for the whole body.
Examples
class Checkout(IPaymentGateway gateway)makesgatewayusable anywhere in the class body.
See also