Sie sind hier: Lexikon/Glossar
Werbung

Was ist C# Code Generators ?

Mit Code-Generatoren (neu seit C# 9.0) kann ein Entwickler zusätzlichen Programmcode zur Kompilierungszeit erzeugen, der zusammen mit dem eigentlichen Programmcode kompiliert wird. Damit kann man z.B. Annotationen eine Bedeutung geben.

"C# code generators are a component you can write that is similar to a roslyn analyzer or code fix. The difference is that code generators analyze code and write new source code files as part of the compilation process. A typical code generator searches code for attributes or other conventions.

A code generator read attributes or other code elements using the Roslyn analysis APIs. From that information, it adds new code to the compilation. Source generators can only add code; they aren't allowed to modify any existing code in the compilation."

[https://docs.microsoft.com/de-de/dotnet/csharp/whats-new/csharp-9#init-only-setters]

Beratung & Support

Schulungen

  Anfrage für eine individuelle Schulung zum Thema C# CODE GENERATORS   Gesamter Schulungsthemenkatalog

Fachbücher

  Alle unsere aktuellen Fachbücher   E-Book-Abo für ab 99 Euro im Jahr