elideus-dot-net-framework-external-services
2.1.0
dotnet add package elideus-dot-net-framework-external-services --version 2.1.0
NuGet\Install-Package elideus-dot-net-framework-external-services -Version 2.1.0
<PackageReference Include="elideus-dot-net-framework-external-services" Version="2.1.0" />
<PackageVersion Include="elideus-dot-net-framework-external-services" Version="2.1.0" />
<PackageReference Include="elideus-dot-net-framework-external-services" />
paket add elideus-dot-net-framework-external-services --version 2.1.0
#r "nuget: elideus-dot-net-framework-external-services, 2.1.0"
#addin nuget:?package=elideus-dot-net-framework-external-services&version=2.1.0
#tool nuget:?package=elideus-dot-net-framework-external-services&version=2.1.0
Elideus | DotNet Framework External Services
External Services is a subpackage of the Elideus-DotNet-Framework that specifies the basic operations required to call an external service using HttpClient
.
Overview
This package includes a class called ExternalServiceProvider
which implements IExternalServiceProvider
. It defines the method CallExternalPostOperation
, which handles serialization and the HTTP request process.
Creating a Service Provider
Suppose we have an external application responsible for authentication. To interact with it, we define an interface:
public interface IAuthAppProvider : IExternalServiceProvider
{
public Task<AuthenticateOutput> Authenticate(AuthenticateInput input);
}
Now, we implement this interface in a class that inherits from ExternalServiceProvider
.
In the constructor, instantiate the HttpClient
:
public AuthAppProvider(IApplicationContext _applicationContext) : base(_applicationContext)
{
httpClient = new HttpClient();
}
Override the GetServiceUrl
method to define the base URL of the external service:
protected override string GetServiceUrl()
{
return "https://url-to-ou-service.com";
}
Finally, use the CallExternalPostOperation
method to perform the request. Specify the endpoint and the input/output types:
public class AuthAppProvider : ExternalServiceProvider, IAuthAppProvider
{
public Task<AuthenticateOutput> Authenticate(AuthenticateInput input)
{
return CallExternalPostOperation<AuthenticateInput, AuthenticateOutput>("Authenticate", input);
}
}
Using the Provider
Once you inject this dependency as described in the Core documentation,
you can use it in your operations like any other dependency.
This enables seamless interaction with external APIs while keeping your codebase clean and structured.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- elideus-dot-net-framework-core (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.1.0 | 153 | 4/10/2025 |