![]() |
VOOZH | about |
dotnet add package TAF.MetaData.SDK --version 10.1.5
NuGet\Install-Package TAF.MetaData.SDK -Version 10.1.5
<PackageReference Include="TAF.MetaData.SDK" Version="10.1.5" />
<PackageVersion Include="TAF.MetaData.SDK" Version="10.1.5" />Directory.Packages.props
<PackageReference Include="TAF.MetaData.SDK" />Project file
paket add TAF.MetaData.SDK --version 10.1.5
#r "nuget: TAF.MetaData.SDK, 10.1.5"
#:package TAF.MetaData.SDK@10.1.5
#addin nuget:?package=TAF.MetaData.SDK&version=10.1.5Install as a Cake Addin
#tool nuget:?package=TAF.MetaData.SDK&version=10.1.5Install as a Cake Tool
A professional, HTTP-based SDK for consuming TAF Metadata Service APIs. This SDK follows Clean Architecture and SOLID principles, providing enterprise-grade metadata retrieval capabilities with automatic context resolution.
TAF.MetaData.SDK.Contracts namespace must update to TAF.MetaData.Contracts or TAF.MetaData.Domainโ
Clean Architecture - Proper separation of layers: Client, Infrastructure, Services, Interfaces, Core
โ
SOLID Principles - Single responsibility, dependency inversion, interface segregation
โ
Industry Standards - Follows AWS, Azure, Stripe SDK naming conventions
โ
HTTP-First - Lightweight, direct API communication
โ
Auto Context Resolution - Automatic TenantId/AppId extraction from headers
โ
Comprehensive Error Handling - Proper exception mapping and status codes
โ
Dependency Injection - Seamless .NET DI integration with validation
dotnet add package TAF.MetaData.SDK
Add metadata service configuration to your appsettings.json:
{
"MetadataService": {
"BaseUrl": "https://your-metadata-service.com",
"Timeout": 30
}
}
Simple configuration from appsettings:
using TAF.MetaData.SDK.Extensions;
var builder = WebApplication.CreateBuilder(args);
// One-line registration with appsettings
builder.Services.AddMetadataClient(builder.Configuration);
var app = builder.Build();
Advanced manual configuration:
// Custom configuration
builder.Services.AddMetadataClient(options =>
{
options.BaseUrl = "https://metadata-api.production.com";
options.TimeoutSeconds = 45;
});
Inject and use the client in your services:
public class MyService
{
private readonly IMetadataClient _metadataClient;
public MyService(IMetadataClient metadataClient)
{
_metadataClient = metadataClient;
}
public async Task<AppObjectResponse?> GetUserProfile()
{
// Context (TenantId, AppId) automatically resolved from HTTP headers
return await _metadataClient.GetAppObjectAsync(
appObjectName: "UserProfile",
version: "1.2.0" // optional
);
}
}
Ensure your HTTP requests include the required context headers:
GET /api/myendpoint
TenantId: 123e4567-e89b-12d3-a456-426614174000
AppId: 987fcdeb-51a2-43d1-9f12-345678901234
CorrelationId: req-12345-67890 (optional)
Task<AppObjectResponse?> GetAppObjectAsync(
string appObjectName,
string? version = null,
CancellationToken cancellationToken = default)
Parameters:
appObjectName - Name of the application object to retrieveversion - Optional version filter (default: null)cancellationToken - Cancellation tokenReturns: AppObjectResponse if found, null if not found
Throws:
ArgumentException - When appObjectName is null/emptyInvalidOperationException - When required headers are missingMetadataServiceException - When service operation failsTask<OperationResult<IEnumerable<ConnectionDto>>> GetConnectionsByEnvironmentAsync(
Guid appEnvironmentId,
BusContext context,
CancellationToken cancellationToken = default)
Parameters:
appEnvironmentId - The application environment identifiercontext - Context containing TenantId, AppId, CorrelationIdcancellationToken - Cancellation tokenReturns: OperationResult containing collection of connections for the environment
Task<OperationResult<IEnumerable<ConnectionDto>>> GetConnectionsByAppAsync(
Guid appId,
BusContext context,
CancellationToken cancellationToken = default)
Parameters:
appId - The application identifiercontext - Context containing TenantId, AppId, CorrelationIdcancellationToken - Cancellation tokenReturns: OperationResult containing collection of connections for the application
public class AppObjectResponse
{
public Guid Id { get; set; }
public Guid TenantId { get; set; }
public Guid AppId { get; set; }
public Guid AppObjectId { get; set; }
public string AppObjectName { get; set; }
public string AppObjectJson { get; set; }
public string? Version { get; set; }
public bool IsCustom { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}
TAF.Metadata.SDK/
โโโ Client/ # Consumer-facing implementations
โ โโโ HttpMetadataClient.cs
โโโ Infrastructure/ # External dependencies (HTTP context)
โ โโโ HttpContextProvider.cs
โโโ Services/ # Internal business services
โ โโโ MetadataUrlBuilder.cs
โ โโโ MetadataHttpRequestFactory.cs
โ โโโ MetadataResponseProcessor.cs
โโโ Interfaces/ # Contracts/abstractions
โ โโโ IMetadataClient.cs
โ โโโ IContextProvider.cs
โ โโโ ...
โโโ Core/ # Domain objects
โ โโโ MetadataContext.cs
โโโ Configuration/ # Options pattern
โ โโโ MetadataServiceOptions.cs
โโโ Extensions/ # DI registration
โโโ ServiceCollectionExtensions.cs
IMetadataClient, IContextProvider)The SDK automatically extracts context from HTTP request headers:
// No manual context needed - extracted automatically!
var appObject = await _metadataClient.GetAppObjectAsync("UserProfile");
// Behind the scenes:
// 1. HttpContextProvider reads Request.Headers["TenantId"]
// 2. HttpContextProvider reads Request.Headers["AppId"]
// 3. HttpContextProvider reads Request.Headers["CorrelationId"] (optional)
// 4. Context passed to metadata service automatically
try
{
var userProfile = await _metadataClient.GetAppObjectAsync("UserProfile");
if (userProfile == null)
{
// Object not found (404)
Console.WriteLine("UserProfile not found");
}
}
catch (InvalidOperationException ex)
{
// Missing required headers
Console.WriteLine($"Missing context: {ex.Message}");
}
catch (MetadataServiceException ex)
{
// Service errors (network, timeout, API errors)
Console.WriteLine($"Service error: {ex.Message}, Status: {ex.StatusCode}");
}
public class MetadataServiceOptions
{
public string BaseUrl { get; set; } = string.Empty;
public int TimeoutSeconds { get; set; } = 30;
}
Configuration validation:
BaseUrl - Required, must be valid URLTimeoutSeconds - Must be between 1 and 300 secondsAddMetadataClient(configuration)This SDK is maintained by the TAF Development Team. For issues or feature requests, please contact the development team.
MIT License - see LICENSE file for details.
๐ค Generated with Claude Code
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.5 | 176 | 5/20/2026 |
| 10.1.4 | 300 | 5/12/2026 |
| 10.1.3 | 377 | 4/15/2026 |
| 10.1.2 | 157 | 4/1/2026 |
| 10.0.3 | 158 | 3/5/2026 |
| 10.0.2 | 128 | 2/24/2026 |
| 10.0.1 | 165 | 2/10/2026 |
| 10.0.0 | 133 | 2/2/2026 |
| 9.3.4 | 124 | 1/22/2026 |
| 9.3.3 | 172 | 1/15/2026 |
| 9.3.2 | 718 | 1/12/2026 |
| 9.3.1 | 132 | 1/9/2026 |
| 9.3.0 | 242 | 1/3/2026 |
| 9.2.2 | 189 | 12/30/2025 |
| 9.2.1 | 137 | 12/30/2025 |
| 9.2.0 | 369 | 12/12/2025 |
| 9.1.0 | 180 | 12/12/2025 |
| 9.0.5 | 428 | 11/11/2025 |
| 9.0.4 | 248 | 11/4/2025 |
| 9.0.0 | 240 | 11/4/2025 |