.NET client for the Viren API
Package | Version |
---|---|
Viren.Core | |
Viren.Execution | |
Viren.Execution.Extensions.DependencyInjection |
using Viren.Execution;
using Environment = Viren.Core.Enums.Environment;
var clientSecret = "";
var environment = Environment.Production;
var httpClient = VirenHttpClientFactory.Create(clientSecret, environment);
var executionClient = new ExecutionClient(httpClient);
var request = new ExecuteCalculationRequest()
{
Project = "Project",
Model = "Model",
Version = 1,
Revision = null,
Root = new Dictionary<string, object>
{
{ "Input", 5 }
},
EntryPoint = "RootBlock",
// Optionally specify an identifier to mark multiple calls as part of a single user session
ClientSessionId = "my-session-identifier"
};
var calculation = client.Calculation.Execute(request);
calculation.Wait();
return calculation.Result.Result;
var request = new GetLookupTablesRequest()
{
Project = "Project",
Model = "Model",
Version = 1,
Revision = null,
GlobalIds = new []{"CarTable", "WageTable"}
};
var tables = client.Model.GetTables(request);
tables.Wait();
return tables.Result.Result;