BMSnet.Client
2.0.3
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
<PackageReference Include="BMSnet.Client" Version="2.0.3" />
<PackageVersion Include="BMSnet.Client" Version="2.0.3" />
<PackageReference Include="BMSnet.Client" />
paket add BMSnet.Client --version 2.0.3
#r "nuget: BMSnet.Client, 2.0.3"
#:package BMSnet.Client@2.0.3
#addin nuget:?package=BMSnet.Client&version=2.0.3
#tool nuget:?package=BMSnet.Client&version=2.0.3
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
BMSnetClientclass 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 2: Dependency Injection (Recommended)
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 accessBMSnetClientOptions.DataApiReadOnlyScope="bmsnetdataapi_readonly"- Read-only access
Available Default URIs
BMSnetClientOptions.DefaultTokenEndpoint- Default OAuth token endpointBMSnetClientOptions.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
DataModelClientwithBMSnetClient - Replace
TimeSeriesClientwithBMSnetClient - All methods remain the same
- Update your DI registration to use the new class name
License
MIT
| Product | Versions 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
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.