ToString
The method every .NET object has for producing a text form of itself.
In more detail
Classes that do not override it just print their type name. Records generate a readable ToString listing the type name and every member, such as Product { Id = 1, Name = Kettle }.
Related terms
- record — A C# type declared with the record keyword for data, for which the compiler generates a constructor, properties, value equality, a readable ToString and with-expression copying.
Taught in
- The C# Language: Types, Variables, and Flow Control — Modern .NET Core, C# & Enterprise Microservices
- Records, Pattern Matching, and Modern C# — Modern .NET Core, C# & Enterprise Microservices