Skip to content

Bugfix for DI#37

Merged
kraldev merged 3 commits into
masterfrom
bugfix/di-fix
Jan 20, 2026
Merged

Bugfix for DI#37
kraldev merged 3 commits into
masterfrom
bugfix/di-fix

Conversation

@kraldev
Copy link
Copy Markdown
Owner

@kraldev kraldev commented Jan 20, 2026

PR Classification

Refactor to align dependency injection and configuration with .NET options pattern.

PR Summary

This pull request updates the registration and injection of BusinessCentralOptions to use Microsoft.Extensions.Options, improving configuration management and DI consistency.

  • BusinessCentralClient.cs: Refactored constructor to accept IOptions and updated usage accordingly.
  • ServiceCollectionExtensions.cs: Replaced direct options registration with AddOptions, added validation, and improved DI registrations for client and observer.
  • TestBase.cs and ServiceCollectionExtensionsTests.cs: Updated tests to use Options.Create and resolve IOptions.
  • Dynamics365.BusinessCentral.csproj: Bumped package version to 1.0.0-beta2.

kraldev and others added 3 commits January 20, 2026 17:38
Refactored AddBusinessCentral to use AddHttpClient<IBusinessCentralClient>() for improved flexibility and best practices. Updated tests to resolve BusinessCentralClient directly and assert interface implementation, enhancing DI correctness and maintainability.
Refactored BusinessCentralClient and service registration to use Microsoft.Extensions.Options for BusinessCentralOptions configuration and validation. Improved AddBusinessCentral to validate options on startup and register both client and interface with HttpClient. Updated tests and observer registration for consistency. Bumped package version to 1.0.0-beta2.
@sonarqubecloud
Copy link
Copy Markdown

@kraldev kraldev merged commit 33aa93c into master Jan 20, 2026
2 checks passed
@kraldev kraldev deleted the bugfix/di-fix branch January 20, 2026 17:13
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.

1 participant