BMSnet.Client 2.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package BMSnet.Client --version 2.0.3
                    
NuGet\Install-Package BMSnet.Client -Version 2.0.3
                    
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="BMSnet.Client" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BMSnet.Client" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="BMSnet.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BMSnet.Client --version 2.0.3
                    
#r "nuget: BMSnet.Client, 2.0.3"
                    
#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.
#:package BMSnet.Client@2.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BMSnet.Client&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=BMSnet.Client&version=2.0.3
                    
Install as a Cake Tool

BMSnet.Client

A .NET client library for accessing BMSnet APIs, including Data Model and Time Series operations through a unified client interface.

Installation

What's New in Version 2.0

  • Unified Client: Single BMSnetClient class instead of multiple specialized clients (DataModelClient, TimeSeriesClient)
  • Simplified API: All operations (entities, time series, etc.) available through one client
  • Same Great Features: Token caching, entity caching, flexible configuration, and DI support

Configuration

The library uses the Options pattern for configuration. You need to provide your OAuth credentials and optionally customize endpoints and scopes.

Option 1: Direct Instantiation

Read-Only Access

Option 3: Configuration from appsettings.json

Configuration Scenarios

Custom Environment

For testing against a different environment:

Different API Version

To use a different API version:

Configuration Options

Property Type Required Default Description
ClientId string Yes - OAuth client ID
ClientSecret string Yes - OAuth client secret
Scope string Yes DataApiScope OAuth scope - use DataApiScope for read/write or DataApiReadOnlyScope for read-only
TokenEndpoint Uri No https://bmsnet.cas.dtu.dk/login/connect/token OAuth token endpoint URL
DataApiBaseUrl Uri No https://bmsdata.cas.dtu.dk/api/v4/ Base URL for BMSnet Data API
TokenRefreshBufferSeconds int No 60 Seconds before expiry to refresh token

Available Scope Constants

  • BMSnetClientOptions.DataApiScope = "bmsnetdataapi" - Full read/write access
  • BMSnetClientOptions.DataApiReadOnlyScope = "bmsnetdataapi_readonly" - Read-only access

Available Default URIs

  • BMSnetClientOptions.DefaultTokenEndpoint - Default OAuth token endpoint
  • BMSnetClientOptions.DefaultDataApiBaseUrl - Default Data API base URL

Entity Caching

Enable entity caching to avoid repeated API calls for the same entity:

Note: Cache is automatically invalidated when you update or delete an entity.

Azure Functions Integration

For optimal performance in Azure Functions, register the client as a singleton:

Usage Examples

Entity Operations

Query Entities

Response

Get Single Entity

Response

Create Entity

Response

Delete Entity

Response

Time Series Operations

Get Time Series Data

Response

Post Time Series Data

Response

Helper Methods

// Example C# code for helper methods
public class ExampleHelper
{
    public int Add(int a, int b)
    {
        return a + b;
    }
}

Response

Thread Safety

The BMSnetClient is thread-safe. Token refresh is protected by internal locking mechanisms, making it safe to use as a singleton in web applications and Azure Functions.

Migration from Version 1.x

If you're upgrading from version 1.x:

  • Replace DataModelClient with BMSnetClient
  • Replace TimeSeriesClient with BMSnetClient
  • All methods remain the same
  • Update your DI registration to use the new class name

License

MIT

Product 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.

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
3.2.0 91 5/19/2026
3.1.1 92 5/18/2026
3.1.0 89 5/18/2026
3.0.2 88 5/18/2026
3.0.1 85 5/18/2026
3.0.0 88 5/18/2026
2.0.3 103 3/31/2026
2.0.2 98 3/31/2026
2.0.1 107 3/27/2026
2.0.0 101 3/27/2026
1.0.6 109 2/27/2026
1.0.5 194 12/22/2025
1.0.4 191 12/22/2025
1.0.3 253 12/15/2025
1.0.2 254 12/15/2025
1.0.1 133 12/12/2025
1.0.0 199 11/24/2025

Internal improvements.