Enforce explicit return types on public APIs with a Roslyn analyzer
A custom Roslyn analyzer flags `var` in public .NET method signatures inside Visual Studio, turning code-review nits into build-time diagnostics.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
A custom Roslyn analyzer flags `var` in public .NET method signatures inside Visual Studio, turning code-review nits into build-time diagnostics.
Source generators move mapping boilerplate from runtime reflection to compile-time code emission. A worked example shows a tiny attribute-driven mapper that produces debuggable, zero-overhead C# during the build.
NET 8 doesn't include a built-in DataAnnotations source generator. This post shows how to write a minimal generator that emits a fast Validate method for your DTOs, moving validation from runtime reflection to compile-time code generation.