TipsTrade.ApiClient.Core
8.0.0
dotnet add package TipsTrade.ApiClient.Core --version 8.0.0
NuGet\Install-Package TipsTrade.ApiClient.Core -Version 8.0.0
<PackageReference Include="TipsTrade.ApiClient.Core" Version="8.0.0" />
<PackageVersion Include="TipsTrade.ApiClient.Core" Version="8.0.0" />
<PackageReference Include="TipsTrade.ApiClient.Core" />
paket add TipsTrade.ApiClient.Core --version 8.0.0
#r "nuget: TipsTrade.ApiClient.Core, 8.0.0"
#:package TipsTrade.ApiClient.Core@8.0.0
#addin nuget:?package=TipsTrade.ApiClient.Core&version=8.0.0
#tool nuget:?package=TipsTrade.ApiClient.Core&version=8.0.0
TipsTrade.ApiClient.Core 
A collection of interfaces, classes and extension methods commonly used when writing API client libraries.
Versioning
- As of version 8.x the package major version follows the .NET target version (e.g.
8.x.xtargetsnet8.0).
Supported target frameworks
net8.0net481(for compatibility with older .NET Framework projects, but may not receive all new features going forward).
Packaging
- Project generates a NuGet package on build (
GeneratePackageOnBuild=true) and usesREADME.mdas the package readme. - Project depends on
Microsoft.Extensions.Logging.Abstractions(core package).
Namespaces and important types
TipsTrade.ApiClient.Core.Caching
IAddToCache<TKey>/IAddToCache<TKey, TValue>� methods to add items to a cache (AddToCacheAsync).IGetFromCache<TKey>/IGetFromCache<TKey, TValue>� methods to retrieve items from a cache (GetFromCacheAsync).IReadWriteCache<TKey>/IReadWriteCache<TKey, TValue>� convenience interfaces combining add/get.
TipsTrade.ApiClient.Core.Credential
IIsValid� exposesbool IsValid { get; }for credential validation.UserCredential� simple user credentials (Username,Password) withIsValidbehavior.ApiKeyCredential� simple API key credentials (ApiKey, optionalSecret) withIsValidbehavior.IGetCredential<TKey>andIGetCredential<TKey, TCredential>� retrieval methods:GetCredentialAsync<TCredential>(TKey key, ...)andGetCredentialAsync(TKey key, ...).ISetCredential<TKey, TCredential>�SetCredentialAsync(TKey key, TCredential credential, ...).- Extension methods:
GetCredentialOrThrowAsync� wrapsGetCredentialAsyncand throws a standardized exception (logs failure).TrySetCredentialAsync� callsSetCredentialAsyncand returnstrueon success,falseon failure (logs failure).
TipsTrade.ApiClient.Core.Error
ApiException� exception type representing API errors. Properties:object? Error,string? Provider,HttpStatusCode? StatusCode. Factory:ApiException.FromHttpError(...).HttpStatusCode.GetErrorMessage()� extension that returns a human-readable fallback message for common HTTP status codes.
TipsTrade.ApiClient.Core.Logging
IWithLogger� exposesILogger? Logger { get; }.- Extensions:
GetLogger<T>(this T? value)� returnsILogger?if the value implementsIWithLogger.LogIf(this ILogger? logger, LogLevel level, Func<string> message)� logs only when theLogLevelis enabled.
TipsTrade.ApiClient.Core.Tenant
IGetTenant/IGetTenant<T>�GetTenantAsync(...)to obtain tenant values.- Extension methods:
GetTenantOrDefaultAsync(this IGetTenant? tenant)� returns tenant string or"(default)".GetTenantOrDefaultAsync<T>(this IGetTenant<T>? tenant, T defaultValue)� returns tenant or provided default.GetTenantOrThrowAsyncvariants � wrap retrieval, log on error and throw standardized exception.
TipsTrade.ApiClient.Core.Threading
KeyedSemaphoreSlim<K>� a thread-safe keyedSemaphoreSlimstore backed byConcurrentDictionary<K, SemaphoreSlim>. Features:WaitAsync(K key, ...)to wait on a specific key.Release(K key)/TryRelease(K key)to release.ContainsKey,GetCurrentCount, and configurable default counts.
Tests
- The repository includes unit tests that exercise credential helpers, error helpers, JSON attribute assertions, threading utilities, and other behaviors.
Notes
- The README has been synchronized with the codebase: method names, available extension methods, and interfaces reflect the actual source files.
- For implementation details, public APIs and XML documentation are available in the source under the respective folders (e.g.
Credential,Error,Logging,Tenant,Caching,Threading).
| 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. |
| .NET Framework | net481 is compatible. |
-
.NETFramework 4.8.1
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on TipsTrade.ApiClient.Core:
| Package | Downloads |
|---|---|
|
TipsTrade-HMRC
A strongly typed .NET client for interacting with the HMRC APIs |
|
|
TipsTrade.Dvla
Provides access to the DVLA APIs. |
|
|
TipsTrade.VCheck
Package Description |
|
|
TipsTrade.UkVehicleData
HTTP client and dependency-injection extensions for the UK Vehicle Data REST API |
GitHub repositories
This package is not used by any popular GitHub repositories.