Skip to content

New interfaces#2

Merged
magesoe merged 10 commits into
masterfrom
new_interfaces
Jun 5, 2025
Merged

New interfaces#2
magesoe merged 10 commits into
masterfrom
new_interfaces

Conversation

@magesoe

@magesoe magesoe commented Jun 5, 2025

Copy link
Copy Markdown
Contributor
  • Added extension method that adds the interfaces ServiceClient implements
  • Added extension method that adds a ServiceClientFactory

@magesoe magesoe requested a review from Copilot June 5, 2025 19:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces new interfaces and extension methods to enhance how ServiceClient instances are registered and resolved, including a new factory pattern for scenarios that require multiple or long-running client instances.

  • Adds documentation in the README.md for using ServiceClientFactory.
  • Updates DI registration in Program.cs with new interfaces and a factory.
  • Introduces new extension methods and supporting files in the DataverseConnection library to create and manage ServiceClient instances.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.md Updated docs with instructions on using ServiceClientFactory for advanced scenarios.
DataverseWhoAmI/Program.cs Updated sample code to resolve ServiceClient via different interfaces and the factory.
DataverseConnection/ServiceCollectionExtensions.cs Added extension methods to register both ServiceClient and organization service interfaces plus factory.
DataverseConnection/ServiceClientFactory.cs Added a new factory class implementing IServiceClientFactory for creating new ServiceClient instances.
DataverseConnection/Internal/ServiceClientBuilder.cs Updated internal builder logic with new C# syntax for array initialization in the token provider.
DataverseConnection/IServiceClientFactory.cs Added a new factory interface for creating ServiceClient instances.
DataverseConnection/DataverseConnection.csproj Updated dependency for Microsoft.Extensions.Caching.Memory from version 8.0.0 to 9.0.0.
Comments suppressed due to low confidence (1)

DataverseConnection/Internal/ServiceClientBuilder.cs:41

  • [nitpick] The square bracket syntax for array initialization is valid in C# 12; consider adding an inline comment to briefly explain this new syntax to help maintainers unfamiliar with recent language updates.
var tokenRequestContext = new TokenRequestContext([resource]);

@magesoe magesoe merged commit 53e368e into master Jun 5, 2025
1 check passed
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.

3 participants