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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="elideus-dot-net-framework-external-services" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="elideus-dot-net-framework-external-services" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="elideus-dot-net-framework-external-services" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add elideus-dot-net-framework-external-services --version 2.1.0
                    
#r "nuget: elideus-dot-net-framework-external-services, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=elideus-dot-net-framework-external-services&version=2.1.0
                    
Install elideus-dot-net-framework-external-services as a Cake Addin
#tool nuget:?package=elideus-dot-net-framework-external-services&version=2.1.0
                    
Install elideus-dot-net-framework-external-services as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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