PolyApi.Tools
0.1.8
dotnet tool install --global PolyApi.Tools --version 0.1.8
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local PolyApi.Tools --version 0.1.8
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=PolyApi.Tools&version=0.1.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package PolyApi.Tools --version 0.1.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
polyapi-dotnet
Prerequisities
- Install .NET SDK 8.0
- Install following Add-Ons into VS Code (and restart VS Code):
(Optional) Boostrap console project
- create project folder
- go to the project folder
- Run:
dotnet new console
Install PolyApi-Tools
(Optional) - To instal the PolyApi-Tool locally we need to prepare manifest in project folder or any folder above it (so it can be shared with multiple projects). Details: https://learn.microsoft.com/en-us/dotnet/core/tools/local-tools-how-to-use
- Go to the foder where you want to crate manifest (e.g. project folder, root of your repository,..)
- Run
dotnet new tool-manifest
command
Install of update PolyApi-Tools using (this will install latest version)
- Locally (with step 1):
dotnet tool install PolyApi.Tools
- Globally:
dotnet tool install -g PolyApi.Tools
- Locally (with step 1):
Use PolyApi-Tools
- (optional) Setup for local environment. This will write PolyApi BaseUrl and ApiKey into tools configuration.
- Run:
dotnet tool run polyapi setup
- Enter configuration values
- Run:
- Generate Client:
- when configured using step 1.
Run:
dotnet tool run polyapi generate
- when NOT configured using step 1. (e.g. in build pipelines ...)
Run:
dotnet tool run polyapi generate --BaseUrl={POLY INSTANCE BASE URL} --ApiKey={POLY API KEY}
- when configured using step 1.
Run:
Example
To test the setup, enter the following code into Program.cs
(bootstrapped as described above) and run it using the dotnet run
command:
using PolyApi.PolyContext;
var todos = await Poly.jsonPlaceholder.todos.getList();
foreach (var todo in todos.Data)
{
Console.WriteLine(@$"
Title: {todo.Title}
ID: {todo.Id}
Completed: {todo.Completed}");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.