Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alanedwardes/ae.gengo.client

C# client for the Gengo translation service API - https://gengo.com/
https://github.com/alanedwardes/ae.gengo.client

gengo translation

Last synced: 1 day ago
JSON representation

C# client for the Gengo translation service API - https://gengo.com/

Awesome Lists containing this project

README

        

# Ae.Gengo.Client [![](https://img.shields.io/nuget/v/Ae.Gengo.Client.svg)](https://www.nuget.org/packages/Ae.Gengo.Client)
C# client for the Gengo translation service API - https://gengo.com/

## Usage
### With Microsoft.Extensions.DependencyInjection
```csharp
IGengoConfigV2 config = new GengoConfigV2
{
Key = "key",
Secret = "secret"
};

ServiceCollection services = new ServiceCollection();

services.AddGengoClientV2(config, options => options.BaseAddress = new Uri("http://api.gengo.com/"));

IServiceProvider provider = services.BuildServiceProvider();

IGengoClientV2 client = provider.GetRequiredService();
```

### With HTTP Client
```csharp
IGengoConfigV2 config = new GengoConfigV2
{
Key = "key",
Secret = "secret"
};

var handler = new GengoHandlerV2(config)
{
InnerHandler = new HttpClientHandler()
};

var httpClient = new HttpClient(handler)
{
BaseAddress = new Uri("http://api.gengo.com/")
};

IGengoClientV2 client = new GengoClientV2(httpClient);
```