From 98278b70d69e87fd074b93bcf525ab8c2f2f226a Mon Sep 17 00:00:00 2001 From: Victor Irzak Date: Tue, 28 Jul 2026 10:28:42 -0400 Subject: [PATCH 1/2] Point at SharpCompress as a worked example SharpCompress generates its synchronous methods this way, and the migration notes written while converting it answer the questions someone adopting this in an established codebase actually has: how to prove a generated method is the one it replaced, and when attributing a method would add a member rather than remove a duplicate. Generated with Claude Code --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5905f82..fc05a8a 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ This [.NET source generator](https://learn.microsoft.com/en-us/dotnet/csharp/ros - Large data from I/O which cannot be stored in memory before processing: Original async method - Small sample of data in memory, usually a sample of the larger data: Generated sync method +## Used by + +[SharpCompress](https://github.com/adamhathcock/sharpcompress), a compression library for .NET, generates its synchronous methods this way. + +Its [migration notes](https://github.com/adamhathcock/sharpcompress/blob/master/docs/SYNC_METHOD_GENERATION.md) are worth reading before adopting this in a codebase which already has both halves written by hand. They cover how to prove that a generated method is the one it replaces, and when attributing a method would add a member rather than remove a duplicate - a generated `Read(Span)` displaces the shim `Stream` provides, which is a change in behaviour rather than a deduplication. + ## How it works ### CreateSyncVersionAttribute on a method From daaa881ed9ac828b2fd087ead7c6fc3dc54448ff Mon Sep 17 00:00:00 2001 From: Victor Irzak Date: Tue, 28 Jul 2026 12:25:13 -0400 Subject: [PATCH 2/2] List FluentValidation and MiniExcel too Both generate their synchronous methods this way already - FluentValidation since 1.3.8-beta, MiniExcel on 2.0.16. Generated with Claude Code --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fc05a8a..fad1f1b 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,11 @@ This [.NET source generator](https://learn.microsoft.com/en-us/dotnet/csharp/ros ## Used by -[SharpCompress](https://github.com/adamhathcock/sharpcompress), a compression library for .NET, generates its synchronous methods this way. +- [FluentValidation](https://github.com/FluentValidation/FluentValidation) - validation library +- [MiniExcel](https://github.com/mini-software/MiniExcel) - spreadsheet reader and writer +- [SharpCompress](https://github.com/adamhathcock/sharpcompress) - compression library -Its [migration notes](https://github.com/adamhathcock/sharpcompress/blob/master/docs/SYNC_METHOD_GENERATION.md) are worth reading before adopting this in a codebase which already has both halves written by hand. They cover how to prove that a generated method is the one it replaces, and when attributing a method would add a member rather than remove a duplicate - a generated `Read(Span)` displaces the shim `Stream` provides, which is a change in behaviour rather than a deduplication. +SharpCompress's [migration notes](https://github.com/adamhathcock/sharpcompress/blob/master/docs/SYNC_METHOD_GENERATION.md) are worth reading before adopting this in a codebase which already has both halves written by hand. They cover how to prove that a generated method is the one it replaces, and when attributing a method would add a member rather than remove a duplicate - a generated `Read(Span)` displaces the shim `Stream` provides, which is a change in behaviour rather than a deduplication. ## How it works