Interceptors и SourceGenerators: отказываемся от IL-инъекций

Привет! Я Дмитрий Сипаков, ведущий разработчик в Госсервисах Т-Банка. Расскажу про относительно новую фичу .NET — Interceptors: как они работают вместе со Source Generators и как с их помощью можно избавиться от бойлерплейта без IL-инъекций и сторонней магии.

https://habr.com/ru/companies/tbank/articles/1028724/

#NET #Interceptors #SourceGenerators

Interceptors и SourceGenerators: отказываемся от IL-инъекций

Привет! Я Дмитрий Сипаков, ведущий разработчик в Госсервисах Т-Банка. Расскажу про относительно новую фичу .NET — Interceptors: как они работают вместе со Source Generators и как с их помощью можно...

Хабр

Pretty straight forward, once a couple simple helpers intervene.

#DotNet #CSharp #Roslyn #SourceGenerators

Source generation certainly makes Find All References noisy. #DotNet #Roslyn #SourceGenerators

I can't decide which should be true, but surely one of them should be:

* Code marked with [GeneratedCode] should be ignored by code coverage, or
* Generated code should be marked with [ExcludeFromCodeCoverage]

I'm looking at you, code generators for [LoggerMessage] and [GeneratedRegex] and/or Microsoft.Testing.Extensions.CodeCoverage. 👀

#DotNet #Roslyn #SourceGenerators

What are C# source generators and why should you care? In this week’s Breakpoint Show, we chat with @andrewlock about this powerful compiler feature that can transform your .NET codebase. Metaprogramming, but make it clean!

#DotNet #CSharp #SourceGenerators

https://www.breakpoint.show/podcast/episode-041-source-generators-with-andrew-lock/

Episode 041 – Source Generators with Andrew Lock - The Breakpoint Show

https://youtu.be/pdyB0C6vuS8Welcome to the forty-first episode of The Breakpoint Show! In this episode, we're diving into one of the most powerful and often underutilized features in modern C#—source generators. And we’ve brought in a special guest to help guide us through it: Andrew Lock, author, speaker, and all-around .NET expert. Source generators are a feature of

The Breakpoint Show -

Source Generators в C# - від теорії до практики

#dotnet #csharp #sourcegenerators #roslyn

https://taraskovalenko.github.io/posts/source-generators/

Source Generators в C# - від теорії до практики

Source Generators були представлені в .NET 5 як інструмент для генерації коду під час компіляції, це інструмент для метапрограмування під час компіляції в C#. До їх появи розробники використовували різні підходи для генерації коду:

Taras Kovalenko
https://github.com/csharpfritz/InstantAPIs - Generate "instant" #MinimalAPIs for #ASPnet using Reflection or #SourceGenerators. Nice experiment @csharpfritz.
GitHub - csharpfritz/InstantAPIs: A library that generates Minimal API endpoints for an Entity Framework context.

A library that generates Minimal API endpoints for an Entity Framework context. - GitHub - csharpfritz/InstantAPIs: A library that generates Minimal API endpoints for an Entity Framework context.

GitHub
You should not write code that machines can generate #dontent #csharp #mvvm #sourcegenerators
https://github.com/JasonBock/Rocks - Rocks: #Roslyn #SourceGenerators based #Mocks. No reflection penalty. Really cool @jasonbock.
GitHub - JasonBock/Rocks: A mocking library based on the Compiler APIs (Roslyn + Mocks)

A mocking library based on the Compiler APIs (Roslyn + Mocks) - JasonBock/Rocks

GitHub

Hey #dotnet friends using System.Text.Json ✋

Has anyone managed to create code that uses source generators but for snake_case naming policy?

I notice I can not pass anywhere the serializer options when I specify using the source generator, and then I can not pass the snake_case naming policy?

Any help please, repost for reach?

#csharp #aspnet #aspdotnet #serialization #json #snake_case #jsonserializer #sourcegenerators #systemtextjson