Make AddMessagingServiceHttpClient an extension method

Updated the AddMessagingServiceHttpClient method in the
DependencyInjection class to use the `this` keyword for the
IServiceCollection parameter. This change makes the method an
extension method, allowing it to be called directly on an
IServiceCollection instance. This improves usability and aligns
with common dependency injection extension patterns.
This commit is contained in:
2026-11-05 10:11:39 +01:00
parent 05d16bb32c
commit a1165121d1
2 changed files with 4 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ public static class DependencyInjection
/// <param name="services"></param> /// <param name="services"></param>
/// <param name="baseAddress"></param> /// <param name="baseAddress"></param>
/// <returns></returns> /// <returns></returns>
public static IServiceCollection AddMessagingServiceHttpClient(IServiceCollection services, string baseAddress) public static IServiceCollection AddMessagingServiceHttpClient(this IServiceCollection services, string baseAddress)
{ {
// do not call EnsureMessagingServiceClientNotRegistered here because AddMessagingServiceHttpClient is already calling it in the overload above // do not call EnsureMessagingServiceClientNotRegistered here because AddMessagingServiceHttpClient is already calling it in the overload above
return services.AddMessagingServiceHttpClient(client => client.BaseAddress = new Uri(baseAddress)); return services.AddMessagingServiceHttpClient(client => client.BaseAddress = new Uri(baseAddress));

View File

@@ -11,9 +11,9 @@
<PackageIcon>icon.png</PackageIcon> <PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>http://git.dd:3000/AppStd/Rec.git</RepositoryUrl> <RepositoryUrl>http://git.dd:3000/AppStd/Rec.git</RepositoryUrl>
<PackageTags>digital data messaging service api client</PackageTags> <PackageTags>digital data messaging service api client</PackageTags>
<Version>3.0.0</Version> <Version>3.0.1</Version>
<AssemblyVersion>3.0.0.0</AssemblyVersion> <AssemblyVersion>3.0.1.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion> <FileVersion>3.0.1.0</FileVersion>
<Description></Description> <Description></Description>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>