open bi .NET client API
API to communicate with open bi servers. Works with netstandard2.0
and greater on Windows, Linux, macOS, iPhone, Android, Blazor, etc.
Getting started
Add the core package reference to your project like this:
<PackageReference Include="BiExcellence.OpenBi.Api" Version="*" />
Add the following using:
using BiExcellence.OpenBi.Api;
Create a new session which you can use to send and receive custom commands like this:
await using (var session = new OpenBiSession(new OpenBiConfiguration(Protocol.HTTP, "host", 9093, "applicationName")))
{
session.OnRequest += OnRequest;
session.OnResponse += OnResponse;
session.OnError += OnError;
var request = session.CreateRequest("CUSTOM_COMMAND");
request.AddParameter("NAME", "VALUE");
using (var response = await request.SendAsync(cancellationToken))
{
}
}
void OnRequest(object sender, OpenBiRequestEventArgs args) => Console.WriteLine("Request");
void OnResponse(object sender, OpenBiResponseEventArgs args) => Console.WriteLine("Response");
void OnError(object sender, OpenBiErrorEventArgs args) => Console.WriteLine("Error");
All built in commands are implemented as extension methods on IOpenBiSession
so you just need to add additional usings to make them available like this:
using BiExcellence.OpenBi.Api.Commands;
Which contains some common commands like:
var info = await session.PingAsync(cancellationToken);
var loginInfo = await session.OpenBiLoginAsync("username", "password", cancellationToken);
var sessionInfo = await session.GetSessionInformationAsync(cancellationToken);
The more specialized commands are contained in their own NuGet packages.
See the API reference for all avaiable commands.