-
Object-Oriented Programming: Introduction to C#
syntax, types, and class-based object-oriented programming.
- Namespaces: Organizing code using namespaces.
-
Basic Types: Primitive types (int, float, string,
etc.).
-
Control Flow Statements: if, switch, for, foreach,
while, and do-while.
- Exception Handling: try-catch-finally blocks.
-
Methods and Properties: Defining and using methods,
properties, and constructors.
-
Events and Delegates: Defining and subscribing to
events, and using delegates for callback methods.
-
Inheritance and Polymorphism: Fundamental OOP
concepts like inheritance, virtual methods, and method overriding.
-
Generics: Type-safe data structures and methods.
-
Anonymous Methods: Defining inline methods (precursor
to lambda expressions).
-
Partial Classes: Splitting a class definition across
multiple files.
-
Nullable Types: Handling null values with value
types.
-
Iterators and
yield keyword: Simplifying
enumerations.
-
LINQ (Language Integrated Query): Querying data from
different data sources (in-memory collections, databases, XML, etc.).
-
Lambda Expressions: Inline expressions for writing
cleaner code, particularly in LINQ queries.
-
Expression Trees: Representing code in a tree-like
data structure.
-
Extension Methods: Adding methods to existing types
without inheritance.
-
Anonymous Types: Creating objects without explicitly
defining a class.
-
Automatic Properties: Shortening property
declarations.
-
Object and Collection Initializers: Initializing
objects and collections in a single expression.
-
Query Expressions: SQL-like syntax for LINQ queries.
-
Dynamic Types: Introducing dynamic typing with the
dynamic keyword.
-
Named and Optional Parameters: Calling methods with
parameters specified by name or omitted when optional.
-
Covariance and Contravariance: Variance support for
generic interfaces and delegates.
-
Embedded Interop Types: Simplifying interop with COM
components.
-
Task Parallel Library (TPL): Easier multithreading
and parallelism.
-
Asynchronous Programming:
async and
await keywords for easier asynchronous code.
-
Caller Information Attributes: Getting information
about the caller of a method (like file path, line number).
-
Improved Exception Handling: Async exception
handling.
-
Expression-Bodied Members: Defining single-line
methods and properties.
-
Null-Conditional Operators: Simplifying null checks
with
?. and ??.
-
String Interpolation: Embedding expressions directly
within string literals with
$"{}".
-
Auto-Property Initializers: Initializing properties
with default values.
-
nameof operator: Getting the name of a
variable, property, or method as a string.
-
Exception Filters: Filtering exceptions in catch
blocks.
-
Tuples and Deconstruction: Returning multiple values
and unpacking tuples easily.
-
Pattern Matching: Matching types and values in switch
statements and expressions.
-
Local Functions: Defining functions inside methods.
- Out Variables: Declaring out variables inline.
-
Ref Locals and Returns: Returning references from
methods.
-
Expression-Bodied Constructors and Destructors: Using
expression-bodied syntax in more places.
-
Async Main: Supporting asynchronous entry points.
-
Default Literals: Simplifying default value
expressions.
-
In Parameters: Passing parameters by reference
without allowing modification.
-
Ref Structs and ReadOnly Structs: Enhancements for
value type safety and efficiency.
-
Nullable Reference Types: Introducing nullable
annotations to reduce null reference exceptions.
-
Async Streams: Asynchronous iteration over data
sources with
IAsyncEnumerable.
-
Ranges and Indices: Slicing arrays and other
collections with range syntax (e.g.,
^1,
1..3).
-
Default Interface Methods: Adding default method
implementations to interfaces.
-
Switch Expressions: A more concise switch syntax.
-
Pattern Matching Enhancements: Extending pattern
matching to more types and scenarios.
-
Static Local Functions: Local functions that can be
declared as static.
-
Record Types: Immutable types with value-based
equality.
-
Init-Only Properties: Making properties writable only
during object initialization.
-
Top-Level Programs: Simplified program entry point
syntax.
-
With Expressions: Creating copies of objects with
modifications.
-
Enhanced Pattern Matching: Additional patterns like
relational patterns and logical patterns.
-
Covariant Returns: Overriding methods with more
specific return types.
-
Global Usings: Declaring common usings globally for
the entire project.
-
File-Scoped Namespaces: Simplified namespace
declaration for single-file programs.
- Record Structs: Value-type records.
-
Lambda Improvements: Lambdas can be used in more
places, including return types.
-
Interpolated String Handlers: Optimized string
interpolation for performance.
-
Enhanced Async/Parallel Programming: Improved
task-based APIs and async performance.
-
Required Properties: Defining properties that must be
initialized during object creation.
-
Generic Math Support: Math methods extended to work
with generics.
-
Static Abstract Members in Interfaces: Allowing
static members in interfaces for generic scenarios.
-
UTF-8 String Literals: Supporting
u8 suffix for UTF-8 string literals.
-
Primary Constructors for Classes: A shorthand for
declaring constructors alongside class declarations.
-
Collection Literals: More flexible syntax for
initializing collections.
-
Readonly Members for Records: Ensuring immutability
at a member level for record types.
-
Default Interface Methods Enhancements: Expanded
default interface method capabilities.
-
Better Async Programming Features: Enhancements to
async programming to make it more intuitive and performant.
-
Improvements in Pattern Matching: Expanding pattern
matching capabilities with further syntax enhancements.
-
Increased Performance and Efficiency: Continued focus
on performance with better support for high-performance applications.