Skip to content

Enable Microsoft Dependency Injection container support with HTTP client factory integration  #2319

@qodo-merge-for-open-source

Description

@qodo-merge-for-open-source

Description

  • RestSharp needs to integrate with Microsoft's Dependency Injection container to support modern .NET applications using the standard DI patterns
  • HTTP client lifecycle management should leverage the built-in IHttpClientFactory for proper resource handling and connection pooling
  • Test infrastructure should be refactored to support multiple client instantiation patterns while maintaining consistent test coverage

Deliverables

  • DI Extension Library: Create RestSharp.Extensions.DependencyInjection package with ServiceCollectionExtensions providing AddRestClient() methods for various configuration scenarios
  • HTTP Client Factory: Integrate IHttpClientFactory for managed HttpClient creation and configuration through the DI container
  • Shared Test Base: Extract common request test cases into RequestTestsBase to enable test reuse across different client instantiation patterns
  • Test Coverage: Implement DI-specific test suite validating RestClient registration and execution through the dependency injection container

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions