Refit is a .NET library that automatically generates type-safe HTTP API clients from C# interfaces decorated with attributes like [Get], [Post], [Header], [Body], and [Query]. It operates via two parallel request-building paths: a Roslyn source generator that emits inline request construction at compile time (trim/AOT-safe), and a reflection-based fallback for unsupported shapes. The library integrates deeply with Microsoft.Extensions.DependencyInjection and IHttpClientFactory, providing extension methods like AddRefitClient<T> and AddKeyedRefitClient for managed HTTP client lifecycles. It supports multiple serializers (System.Text.Json, Newtonsoft.Json, XML), content compression (gzip, Brotli, Zstandard), streaming responses (IAsyncEnumerable, JSON Lines, SSE), multipart form data, and per-request timeouts and authorization via DelegatingHandler pipelines. The architecture is modular: the core Refit package provides attributes, serialization interfaces, and the runtime GeneratedRequestRunner; Refit.HttpClientFactory adds DI integration; Refit.Newtonsoft.Json and Refit.Xml provide alternative serializers; Refit.Reflection offers the runtime request builder; and Refit.Testing supplies StubHttp and Reply for unit testing without a live server. The source generator (InterfaceStubGeneratorV2) is an incremental generator that parses interfaces and emits partial classes into the consumer assembly, using value-equatable models (ImmutableEquatableArray) for caching. The reflection path caches parsed method metadata and builds requests via delegates, ensuring parity with generated code. Key entry points include RestService.For<T>() for creating clients, AddRefitClient<T>() for DI registration, and RefitSettings for central configuration. External dependencies are minimal: System.Text.Json (built-in), Microsoft.Extensions.Http, and optionally Newtonsoft.Json or System.Xml. The library is extensively tested with unit tests, integration tests, snapshot-based generator tests, and benchmarks measuring allocation and throughput. It targets .NET 8/9/10/11 and .NET Framework 4.6.2+, with polyfills for missing BCL types.
MemoryPack is a high-performance binary serialization library for .NET (C#) that achieves extreme speed through 'zero encoding'βdirect memory copies for blittable types rather than varint/tag-based encodings. It is primarily a library, distributed as multiple NuGet packages, including a Roslyn source generator that compiles serialization code for types marked with [MemoryPackable]. The core library (MemoryPack.Core) provides writer/reader ref structs, a customizable formatter architecture, and support for compression (Brotli), streaming (PipeWriter/PipeReader), version-tolerant and circular-reference serialization, and polymorphism via union types. It integrates with ASP.NET Core via input/output formatters, generates TypeScript/JavaScript serializers for web clients, and ships a Unity package with shims for common Unity types. The codebase is extensively benchmarked and tested, focusing on allocation-free, high-throughput serialization. While not a data research project, it may be used in data pipelines requiring fast, compact binary data exchange.
PropertyChanged.Fody is a Fody add-in (weaver) and Roslyn source generator that automates the implementation of INotifyPropertyChanged (and optionally INotifyPropertyChanging) for .NET classes. The weaver operates on compiled IL using Mono.Cecil, injecting property change notification code into property setters, while the optional source generator emits boilerplate for partial classes at compile time. The tool supports multiple invocation patterns (event, OnPropertyChanged methods, before/after callbacks), attribute-driven dependency detection ([DependsOn], [AlsoNotifyFor]), equality checks before notifications, and extensible interceptors. Configuration is done via FodyWeavers.xml attributes or custom attributes on classes/properties. The project is mature, well-tested, and widely used (nearly 2000 stars), with extensive test coverage across inheritance, generics, nullable types, F#, and integration with MVVM frameworks like Caliburn.Micro and ReactiveUI.
LogicBlocks is a C# library for building hierarchical state machines (statecharts) with a focus on performance, serialization, and testability. It provides a `LogicBlock` base class that manages state transitions via input handlers (`IGet<TInput>`), supports pushdown automaton history, async task integration, and observable bindings. The library includes an `AutoBlock` extension for automatic state preallocation and serialization using Chickensoft's introspection and serialization frameworks, and a Roslyn source generator (`DiagramGenerator`) that produces PlantUML state diagrams from annotated state classes. The codebase is well-structured with extensive unit tests, clean separation of concerns, and a fluent API for bindings. It is designed for AOT environments and game development (Godot). The repository also contains a tutorial and a vending machine example.
Files is a modern, open-source Windows file manager built with WinUI 3 and .NET 10, featuring multitabbing, dual-pane navigation, file tags, cloud drive integration, FTP support, Git version control, and a widget-based home page. The architecture is a modular monolith with separate projects for the main app (Files.App), a server component (Files.App.Server), storage abstractions (Files.App.Storage, Files.Core.Storage), a source generator for CsWinRT interop (Files.Core.SourceGenerator), and custom UI controls (Files.App.Controls). The codebase makes heavy use of source-generated P/Invoke via CsWin32, Roslyn source generators for VTable functions and command managers, and the CommunityToolkit.Mvvm pattern with ObservableObject and dependency property source generation. The app supports MSIX packaging, sideload and Store distribution channels, and includes C++/COM components for custom open/save dialogs and a launcher. The last commit was on 2026-06-30, and the project has 44k stars with active CI/CD workflows.
GirCore is a comprehensive C# binding generator and runtime library for GObject-based native libraries (GTK, GStreamer, WebKit, Cairo, etc.). It reads GObject Introspection (GIR) XML files and produces strongly-typed C# bindings with P/Invoke declarations, SafeHandle memory management, and high-level managed APIs. The architecture consists of a generation pipeline (GirLoader parses GIR, GirModel defines an interface-based intermediate representation, Generator applies fixers and renders C# code via a modular converter system) and a set of runtime libraries (GLib, GObject, Gtk, etc.) that provide safe wrappers, signal handling, subclassing support, and platform abstraction. Key entry points include the GirTool CLI for regeneration, Module.Initialize() for library initialization, and Roslyn source generators/analyzers for GObject subclassing and GTK composite templates. The project is pre-1.0 but actively used by several desktop applications and the .NET MAUI Linux backend.
The GodotSharp.SourceGenerators repository provides a set of Roslyn source generators designed to enhance the Godot Engine C# development experience. These generators inspect C# source code for specific attributes (such as `[SceneTree]`, `[AnimNames]`, `[AudioBus]`, etc.) and generate corresponding strongly-typed accessor code, eliminating the need for magic strings and improving compile-time safety. The project supports both Godot 3 and Godot 4 versions, with a clear migration path outlined in the documentation. The architecture follows a modular pattern where each feature (e.g., scene tree access, animation names) is implemented as a separate extension. Each extension consists of an attribute, a data model, a scraper to extract information from the project and source files, a source generator that uses Scriban templates to produce C# code, and the template itself. Shared utilities handle common tasks such as path resolution, string manipulation, and unique ID generation, promoting code reuse and consistency across generators. The repository includes extensive test suites for both Godot 3 and 4, validating the generated code against various scenarios including inheritance, same-name handling, nullable reference types, and edge cases. This ensures the generators remain robust despite Godot's evolving API. The project is actively maintained, with recent commits and a structured approach to handling breaking changes between versions.
AutoFilterer is a .NET library that automatically generates LINQ expressions from Data Transfer Objects (DTOs) for filtering, sorting, and pagination on IQueryable collections. It is designed to be compatible with OpenAPI 3.0 specifications, unlike oData or GraphQL. The core architecture revolves around filter DTOs that inherit from FilterBase or its derivatives (PaginationFilterBase, OrderableFilterBase). Properties in these DTOs are decorated with attributes (e.g., StringFilterOptions, OperatorComparison, CompareTo) or use special types (StringFilter, OperatorFilter<T>, Range<T>) to define filtering rules. The library builds expression trees at runtime and applies them via the ApplyFilter extension method. It also provides a Swagger integration package (AutoFilterer.Swagger) to expose filter parameters in Swagger UI, and a source generator (AutoFilterer.Generators) to automatically create filter DTOs from entity classes. The codebase is well-structured with clear separation of concerns: abstractions (IFilter, IFilterableType), attributes, types, extensions, and a dynamic filter variant. It includes comprehensive unit tests, benchmark tests, and a sandbox application demonstrating usage with a Northwind database. The library targets netstandard2.0, netstandard2.1, and net9.0, making it broadly compatible. While the core library is mature and actively maintained, some ancillary packages (e.g., Swagger integration) use slightly outdated dependencies (Swashbuckle 5.x), and the documentation has some TODO sections. Overall, it is a solid, reusable filtering framework with high craftsmanship in expression tree manipulation.
H5 is a C# to JavaScript/TypeScript transpiler that enables C# developers to target web platforms. The system consists of a compiler service (h5-compiler dotnet tool), a translator core that converts C# AST to JavaScript/TypeScript using visitor patterns and attribute-driven rules, and runtime libraries providing .NET-like functionality in JavaScript. Key features include SDK-style project integration, extensive globalization support through locale definitions, and support for JavaScript interop via attributes like [H5.External] and [H5.Template]. The toolchain processes C# source files through lexical analysis (using NRefactory), semantic analysis, translation to target language syntax, and emits JavaScript/TypeScript output with optional source maps and HTML wrappers.
WinFormsComInterop is a .NET library that provides a custom ComWrappers implementation for Windows Forms (and WebView2) to enable NativeAOT compilation and trimming. It includes a source generator that automatically produces Runtime Callable Wrappers (RCW) and COM Callable Wrappers (CCW) for arbitrary COM interfaces, reducing manual interop code. The repository also contains facade assemblies that stub out dependencies on System.Windows.Forms, WindowsBase, PresentationCore, and Microsoft.Web.WebView2.Core, allowing AOT-friendly builds without full desktop framework references. Multiple sample applications demonstrate usage with WinForms, Blazor Hybrid, hosted WinForms in native DLLs, and trimming. The project is actively maintained and targets .NET 6 through .NET 10, but relies on pre-release SDK versions and has some experimental components (WPF, WinUI) that are not production-ready.