Lasty.Net 0.0.1

dotnet add package Lasty.Net --version 0.0.1
NuGet\Install-Package Lasty.Net -Version 0.0.1
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="Lasty.Net" Version="0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Lasty.Net --version 0.0.1
#r "nuget: Lasty.Net, 0.0.1"
#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.
// 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 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. 
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
0.0.1 175 2/2/2023