📊⚙️ Sankhya .NET SDK.
Build status | Last commit | Tests | Coverage | Code Smells | LoC |
---|---|---|---|---|---|
Download the latest zip file from the Release page.
Package | Version | Downloads |
---|---|---|
Sankhya |
This SDK implements many of Sankhya's web services. Some of them are called Know Services. If the service you seek is not set in the SDK, you can implement the service request/response independently (and use it on your code or submit a pull request to this repository).
Some Request Wrappers allow you to make some requests easily.
The last-mile operations are done on these wrappers. This class defines all HTTP request/response, login/logout, serialization, and download/upload operations.
Avoid using this class directly from your implementation. Only call its methods if you are extending the SDK's functionality or implementing a new feature. Otherwise, I prefer using one of the request wrappers or the Sankhya Context class.
This SDK is based on CrispyWaffle toolkit, so you can use its Service Locator feature to register it.
Assuming you are using Crispy Waffle, you can register the Sankhya wrapper in the Bootstrapper.cs
file this way:
var connectionSankhya = new Connection(); //Fill in your details
ServiceLocator.Register(() => new SankhyaContext(connectionSankhya), LifeStyle.Singleton);
Later, when you need to access the Sankhya Context in your code, you can just pass it as the constructor's argument or retrieve it from Service Locator
public class MyClass {
private readonly SankhyaContext _sankhyaContext;
public MyClass(SankhyaContext sankyaContext) {
_sankhyaContext = sankhyaContext ?? throw new ArgumentNullException(nameof(sankhyaContext));
}
}
var sankhyaContext = ServiceLocator.Resolve<SankhyaContext>();
The KnowServicesRequestWrapper
is a static class that can be used anywhere since SankhyaContext is registered through ServiceLocator.
You can use this to get all active sessions in Sankhya and kill them one by one:
var sessions = KnowServicesRequestWrapper.GetSessions();
foreach (var session in sessions) {
KnowServicesRequestWrapper.KillSession(session.Id);
}
Please open an issue for support.
Refer to CONTRIBUTING.md to learn how to contribute to this project!
Guilherme Branco Stracini |
Fedor Andriyaninkov |
Pedro Henrique |
Viktorius Suwandi |
dependabot[bot] |
github-actions[bot] |
stack-file[bot] |
penify-dev[bot] |
codefactor-io[bot] |
Snyk bot |