Lasty.Net
0.0.1
dotnet add package Lasty.Net --version 0.0.1
NuGet\Install-Package Lasty.Net -Version 0.0.1
<PackageReference Include="Lasty.Net" Version="0.0.1" />
paket add Lasty.Net --version 0.0.1
#r "nuget: Lasty.Net, 0.0.1"
// Install Lasty.Net as a Cake Addin
#addin nuget:?package=Lasty.Net&version=0.0.1
// Install Lasty.Net as a Cake Tool
#tool nuget:?package=Lasty.Net&version=0.0.1
Lasty.Net
Requirements
- .NET 6.0
NuGet
This library is avalaible from NuGet Package Manager
PM> Install-Package Lasty.Net
Dependencies
- Restsharp
Usage
Using DI (1. method)
Register service in Program.cs
:
builder.Services.AddLastyEshopService(config);
Add configurations in appsettings.json
. Example for demo api:
"LastyEshopServiceSettings": {
"BaseUrl": "https://baseurl.com",
"ClientId": "your client id",
"ClientSecret": "your client secret"
}
Using DI (2. method)
It is possible to pass settings directly without using appsettings.json
. Register service in Program.cs
:
var settings = new LastyEshopServiceSettings()
{
"BaseUrl": "https://baseurl.com",
"ClientId": "your client id",
"ClientSecret": "your client secret"
};
builder.Services.AddLastyEshopService(settings);
Using DI will register interface ILastyEshopService which will be used.
Creating instance of LastyEshopService
You can also create instace manualy:
var settings = new LastyEshopServiceSettings()
{
"BaseUrl": "https://baseurl.com",
"ClientId": "your client id",
"ClientSecret": "your client secret"
};
var lastyEshopService = new LastyEshopService(settings);
Methods
GetAccessTokenAsync
Will get access_token.
var result = await _lastyEshopService.GetAccessTokenAsync();
Contributing
Contributions from others would be very much appreciated! Send pull request/ issue. Thanks!
License
Copyright (c) 2023 Petr J�lek. MIT Licensed, see LICENSE for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- RestSharp (>= 108.0.2)
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 |
---|---|---|
0.0.1 | 175 | 2/2/2023 |