Views:

SDKs > C#

This article explains how to install FINBOURNE C# SDKs, how to upgrade C# SDKs, what's included in the upgrade, and any other action you may be required to take.

Note the following:

  • We strongly recommend pinning an SDK to an exact version to control when you take updates and make your builds repeatable.
  • The master/main branch of an SDK may not always have the latest API version; there may, for example, also be v2 or v3 branches. We aim to keep master/main updated with the latest API version, but there may be some lead time while we deprecate older endpoints. Once we deprecate older API versions, the latest API version is moved to the master/main branch.

Installing the latest LUSID C# SDK (Sep. 2023)

As of September 2023, v2 is the latest major version of the LUSID C# SDK. You can install v2 of the LUSID C# SDK from GitHub, or by using the following .NET command:

$ dotnet add package Lusid.Sdk

Click here if you are upgrading to v2 from an existing installation.

Installing v1 of the LUSID C# SDK

For v1 of the LUSID C# SDK, two packages are published:

  • Lusid.Sdk contains only APIs with a lifecycle status of Production or Early Access. You can install the LUSID C# SDK from GitHub, or by using the following .NET command:
    $ dotnet add package Lusid.Sdk --version "[1.*,2.0)"
  • Lusid.Sdk.Preview contains additional APIs with a lifecycle status of Experimental or Beta. You can install the LUSID C# Preview SDK from GitHub, or by using the following .NET command:
    $ dotnet add package Lusid.Sdk.Preview --version "[1.*,2.0)"

Please note v1 of Lusid.Sdk and Lusid.Sdk.Preview will be discontinued from April 2024.

Upgrading to v2

You can upgrade from v1 to v2 of the LUSID C# SDK by using the following .NET command:

$ dotnet add package Lusid.Sdk

We recommend upgrading to this version as soon as possible to ensure you have access to the latest features. Support for the previous SDK version (1.x.x) will be maintained until the end of March 2023. 

Note that you must upgrade all SDKs used in a particular process to v2 at the same time. A process that uses both the Scheduler and Drive SDKs, for example, must either use v1 of both SDKs or v2 of both SDKs; mixing major versions will lead to dependency conflicts.

Users need to update their code to reflect the following v2 changes:

Prerequisites for v2

.NET at version 6.0 or above.

Preview SDKs

This release discontinues publishing the LUSID Preview SDK, instead adding the Experimental and Beta lifecycle APIs to a single SDK. The LUSID C# SDK now contains all the newest features; only Lusid.Sdk need be installed. Note that making requests to Experimental and Beta APIs requires additional licences; for more details please contact support

Long-running API requests

Long-running API requests are enabled, giving users the option to extend or remove request timeout limits (previously timed out at 350 seconds). To extend the timeout on API calls, construct a configuration object and pass it into the ApiFactory, for example:

var configuration = new Configuration
{
    BasePath = "https://<your-domain>.lusid.com/api",
    AccessToken = System.Environment.GetEnvironmentVariable("ACCESS_TOKEN"),
    Timeout = (int)TimeSpan.FromMinutes(10).TotalMilliseconds,
};
var client = new ApiFactory(configuration);

Name changes

The following namespaces, classes and interfaces are renamed:

  • using Lusid.Sdk.Utilities becomes using Lusid.Sdk.Extensions.
  • LusidApiFactory becomes ApiFactoryFactory.
  • ILusidApiFactory becomes IApiFactory.

Version becomes a reserved word in OpenApi Generator:

  • Sdk.Version becomes Sdk.ModelVersion.
  • Any model that implemented an Sdk.Version (now Sdk.ModelVersion) changes from Version to _Version.