This example demonstrates the core WrapGod pipeline: taking a third-party library and generating type-safe wrappers around it.
BasicExample/
VendorLib/ # Simulated third-party library
HttpClient.cs # HTTP client class to wrap
Logger.cs # Logger class + LogLevel enum to wrap
MyApp/ # Consuming application
wrapgod.json # WrapGod manifest — defines which types/members to wrap
Program.cs # Runs the full pipeline end-to-end
BasicExample.slnx # Solution file
- JSON config loading —
wrapgod.jsondeclares which vendor types to include, which members to expose, and how to rename them. - TypeMappingPlanner — Builds a
TypeMappingPlanfrom the config, supporting object mappings, enum casts, and member renames. - TypeMapperEmitter — Generates C# static mapper classes with
Map()methods that convert from vendor types to your wrapper types. - Fluent DSL — Shows the equivalent configuration built programmatically
with the
WrapGodConfigurationfluent API.
# From the repository root
dotnet run --project examples/BasicExample/MyApp/MyApp.csproj
# Or from this directory
dotnet run --project MyApp/MyApp.csprojThe program prints the loaded config summary, the generated mapper source code, and the equivalent fluent DSL configuration to the console.