Skip to content

hasnimehdi91/SaltEdgeNetCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SaltEdgeNetCore

SaltEdgeNetCore is a client for Salt Edge spectre API.

License

This is released under an Apache 2.0 license. See the file LICENSE.txt for more information.

Documentation

The API corresponds to the Salt Edge Documentation

Usage

1- Download nuget package

<PackageReference Include="SaltEdgeNetCore" Version="1.2.0" />

2- In the ConfigureServices method of Startup.cs, register the SaltEdgeNetCore..

Test Mode
public void ConfigureServices(IServiceCollection services)
{
    services.AddSaltEdge(options =>
    {
        options.AppId = "Your App Id";
        options.Secret = "Your secret";
        options.LiveMode = false;
     });
}
Live Mode (Before you go live)
public void ConfigureServices(IServiceCollection services)
{
    services.AddSaltEdge(options =>
    {
        options.AppId = "Your App Id";
        options.Secret = "Your secret";
        options.LiveMode = true;
        options.WithExpiration = 10; // by default  expire  at is set to 10 minute 
        options.PrivateKeyPath = "private.pem" // your private RSA key path;
     });
}

3- Inject the service on the desired controller..

public class TestController : Controller
    {
        private readonly ISaltEdgeClientV5 _clientV5;
        public TestController(ISaltEdgeClientV5 clientV5)
        {
            _clientV5 = clientV5;
        }
        
        // GET
        public IActionResult Index()
        {
            // list all categories supported by salt edge
            return Ok(_clientV5.CategoryList());
        }
    }

Releases

No releases published

Packages

No packages published

Languages