liveBook · Manning

Common Type System

As explained in .NET in Action, Second Edition

The Common Type System is the .NET type model that defines types and their behavior across .NET languages.

The Common Type System (CTS) is the .NET type model that lets types work across .NET languages. It includes classes, structs, enums, value types, records, and other type forms. section 2.4

The CTS distinguishes reference types, which store references to data, from value types, which contain their data directly. This distinction affects parameter passing and copying. C# can box a value such as int into object and unbox it when required. section 2.4 section 2.4

The type model also establishes these practical rules:

  • Strong typing gives every expression, variable, and constant a specific type. section 2.4
  • C# treats values as objects when needed, such as passing an int to Console.WriteLine as an object parameter. section 2.4
  • Dynamic bypasses static type checking, while generic, implicit, anonymous, and nullable types extend the type system. section 2.4

How .NET in Action, Second Edition covers it

How deep it goes
Defines major type categories and boxing behavior, but defers detailed pointer-related discussion and dynamic types.
Examples
Uses int passed to Console.WriteLine, Regex, StringBuilder, classes, structs, enums, records, and other .NET types.
What you can do after
Evaluate how .NET values behave across assignments, method calls, object parameters, and language boundaries.
How it connects
Connects namespaces, reference types, value types, boxing and unboxing, strong typing, and dynamic types.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.