Viren.Execution.Extensions.DependencyInjection
1.0.5
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
Suggested Alternatives
Viren.Execution.Extensions.DependencyInjection 1.1.0
Additional DetailsThe Viren application will stop using the service Auth0 and switch to API Key authentication. This change is being made to improve performance, stability and security for our clients. Please update your package to the latest version before August 1st, 2023. For further questions you can contact our support team at viren-support@viren.be.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Viren.Execution.Extensions.DependencyInjection --version 1.0.5
NuGet\Install-Package Viren.Execution.Extensions.DependencyInjection -Version 1.0.5
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="Viren.Execution.Extensions.DependencyInjection" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Viren.Execution.Extensions.DependencyInjection --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Viren.Execution.Extensions.DependencyInjection, 1.0.5"
#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 Viren.Execution.Extensions.DependencyInjection as a Cake Addin #addin nuget:?package=Viren.Execution.Extensions.DependencyInjection&version=1.0.5 // Install Viren.Execution.Extensions.DependencyInjection as a Cake Tool #tool nuget:?package=Viren.Execution.Extensions.DependencyInjection&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Viren.NET
.NET client for the Viren API
Packages
Package | Version |
---|---|
Viren.Core | |
Viren.Execution | |
Viren.Execution.Extensions.DependencyInjection |
Examples
Viren namespaces and alias
using Viren.Execution;
using Environment = Viren.Core.Enums.Environment;
Creating a client
var auth0ClientId = "";
var auth0ClientSecret = "";
var environment = Environment.Production;
var httpClient = VirenHttpClientFactory.Create(auth0ClientId, auth0ClientSecret, environment);
var executionClient = new ExecutionClient(httpClient);
Execute calculation
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;
Batch calculation
using Viren.Execution;
using Viren.Execution.Requests.Clients;
using Viren.Execution.Requests.Calculations;
using Newtonsoft.Json.Linq;
var client = new ExecutionClient(clientId, clientSecret, Viren.Core.Enums.Environment.Production);
// Optionally register webhook once to receive feedback (multiple registrations simply overwrite existing registration)
var setWebHookRequest = new SetWebHookRequest
{
// Viren will callback on this url at /api/webhook/calculation/complete (for request content see Viren.Execution.Requests.WebHook.CalculationCompleteRequest)
// Depending on your batch size, 1 or more calls will be made until the batch calculation has completed
Url = "http://<your callback endpoint>/",
// Optional OAuth configuration which Viren should use to request an access token to call url specified above,
// if not required leave TokenEndpoint and other settings empty
TokenEndpoint = "https://<your oauth token endpoint>/",
ClientId = "<client_id>",
ClientSecret = "<client_secret>",
Audience = "<audience>",
};
client.Calculation.RegisterWebHook(setWebHookRequest).Wait();
// Execute batch calculaton
var request = new ExecuteCalculationBatchRequest
{
Inputs = new List<ExecuteCalculationBatchInput>
{
new ExecuteCalculationBatchInput
{
Project = "Project",
Model = "Model",
Version = 1,
Revision = null,
EntryPoint = "BlockName",
CalculationInputHeaders = new List<string>{ "Input1", "Input2" },
CalculationInputs = new List<ExecuteCalculationBatchInputItem>
{
new ExecuteCalculationBatchInputItem { RequestId = "<your correlation id>", Root = new List<JValue> { new JValue("Input1 value"), new JValue("Input2 value") } }
}
},
// ...optionally other models to calculate in the same batch
}
};
var batch = client.Calculation.Batch(request);
batch.Wait();
var errors = batch.Result.ValidationMessages;
var batchId = batch.Result.BatchId;
// If webhook is registered, callbacks will contain received batch id with calculation results
Get tables from model
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;
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.Http (>= 2.2.0)
- Viren.Execution (>= 1.0.5)
-
.NETStandard 2.1
- Microsoft.Extensions.Http (>= 2.2.0)
- Viren.Execution (>= 1.0.5)
-
net6.0
- Microsoft.Extensions.Http (>= 2.2.0)
- Viren.Execution (>= 1.0.5)
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 | |
---|---|---|---|
1.1.3 | 283 | 7/6/2023 | |
1.1.2 | 389 | 5/24/2023 | |
1.1.1 | 341 | 5/10/2023 | |
1.1.0 | 925 | 5/5/2023 | |
1.1.0-rc.1 | 74 | 5/3/2023 | |
1.0.5 | 3,009 | 12/10/2021 | |
1.0.4 | 304 | 12/10/2021 | |
1.0.3 | 4,241 | 2/24/2020 | |
1.0.2 | 708 | 11/19/2019 | |
1.0.1 | 503 | 11/8/2019 | |
1.0.0 | 582 | 9/30/2019 | |
0.13.0 | 1,218 | 9/4/2019 | |
0.12.2 | 584 | 8/2/2019 | |
0.12.1 | 589 | 7/31/2019 | |
0.12.0 | 568 | 7/23/2019 | |
0.11.0 | 1,076 | 7/5/2019 | |
0.10.0 | 1,293 | 6/4/2019 | |
0.9.0 | 742 | 6/3/2019 | |
0.9.0-alpha.3 | 326 | 5/31/2019 | |
0.9.0-alpha.2 | 305 | 5/31/2019 | |
0.9.0-alpha.1 | 305 | 5/31/2019 | |
0.8.2 | 625 | 5/17/2019 | |
0.8.1 | 572 | 5/15/2019 | |
0.8.0 | 568 | 5/15/2019 | |
0.7.4 | 591 | 5/10/2019 | |
0.7.3 | 589 | 5/10/2019 | |
0.7.2 | 608 | 4/29/2019 | |
0.7.1 | 627 | 3/11/2019 | |
0.7.0 | 604 | 3/11/2019 | |
0.6.1 | 610 | 2/21/2019 | |
0.6.0 | 656 | 2/20/2019 | |
0.5.7 | 697 | 2/7/2019 | |
0.5.6 | 642 | 1/25/2019 | |
0.5.5 | 637 | 1/25/2019 | |
0.5.4 | 746 | 1/16/2019 | |
0.5.3 | 732 | 1/16/2019 | |
0.5.2 | 721 | 1/3/2019 | |
0.5.1 | 659 | 12/21/2018 | |
0.4.0 | 677 | 12/11/2018 | |
0.3.0 | 703 | 12/5/2018 | |
0.2.0 | 1,193 | 11/5/2018 | |
0.2.0-rc.1 | 432 | 10/31/2018 |