Skip to main content

Practice · 1 of 2

Emit clean generated source

CHALLENGE
Difficulty: advanced+25 XP

Implement static string EmitDto(string className, (string Name, string Type)[] fields) returning a complete, compilable C# source string for public sealed record {className}(...) with the given fields — using FULLY QUALIFIED types for non-primitives (e.g. System.DateTime) so the output compiles without any usings. Primitives (int, string, bool, double) stay as-is.

Back to lesson: Practice: Generator drills