Skip to content

Conversation

@jottakka
Copy link

@jottakka jottakka commented Nov 17, 2025

Refactor: Modern C# Patterns & Improved Architecture

Key Changes

Breaking:

  • Constructor now requires ArcadeClientOptions instead of object initializer
  • HttpClient removed from public API, inject via ArcadeClientOptions.HttpClient
  • Renamed HttpRequest/HttpResponseArcadeRequest/ArcadeResponse (ASP.NET conflict)

New Features:

  • ArcadeClientOptions - strongly-typed configuration with env var support
  • ArcadeClientFactory.Create() - convenient factory methods with shared HttpClient
  • Parameterless constructor using ARCADE_API_KEY and ARCADE_BASE_URL env vars
  • Comprehensive XML documentation on all public APIs

Improvements:

  • Applied modern C# 12 patterns (primary constructors, expression-bodied members, string interpolation)
  • Added 69 behavior-focused unit tests covering edge cases and architectural validation
  • Proper dependency injection support for HttpClient
  • All exception types now sealed with XML docs

Version: 0.1.00.2.0

Verified: Real API integration tests pass ✅

@jottakka jottakka self-assigned this Nov 17, 2025
@jottakka jottakka changed the title [WIP] Updating to C# patterns [WIP] Updating to use some C# patterns Nov 17, 2025
@jottakka jottakka changed the title [WIP] Updating to use some C# patterns Updating to use some C# patterns Nov 17, 2025

var result = await client.Tools.Execute(executeParams);
result.Validate();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: I did not tested with a tool that wasn't authorized already.
I must do it before merging.

Francisco Liberal added 3 commits November 17, 2025 20:27
- IHttpClientFactory support with named clients
- ASP.NET Core DI extensions (AddArcadeClient)
- 5 DI tests (all passing)
- ASP.NET Core example project
- Pre-commit hooks
- PR template
- .gitattributes for generated files
- Consolidated TryParseBaseUrl

18 files changed, 739 insertions(+), 182 deletions(-)
@jottakka jottakka force-pushed the francisco/update-cs-patterns branch from 48c61ae to 5358b4f Compare November 17, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants