Professional HTTP-based SDK for TAF Metadata Service. v10.0.0: Clean release - no caching dependencies. Features Clean Architecture, SOLID principles, explicit BusContext parameter support, comprehensive error handling, screen management, batch relations support, and GUID-based lookups.
$ dotnet add package TAF.MetaData.SDKA comprehensive SDK for consuming TAF Metadata Service APIs. This SDK provides easy-to-use client functionality for retrieving app objects with built-in retry policies and error handling.
✅ App Object Retrieval - Retrieve app objects by name with optional versioning
✅ Retry Policies - Built-in exponential backoff with Polly
✅ Error Handling - Custom exceptions with detailed error information
✅ Dependency Injection - Easy integration with .NET DI container
dotnet add package TAF.MetaData.SDK
Add the metadata service configuration to your appsettings.json:
{
"MetadataService": {
"BaseUrl": "https://your-metadata-service.com",
"TimeoutInSeconds": 30,
"RetryCount": 3
}
}
Register the metadata service client in your Program.cs or Startup.cs:
// Using configuration
builder.Services.AddMetadataService(builder.Configuration);
// Or configure options directly
builder.Services.AddMetadataService(options =>
{
options.BaseUrl = "https://your-metadata-service.com";
options.TimeoutInSeconds = 30;
options.RetryCount = 3;
});
Inject and use the client in your services:
public class MyService
{
private readonly IMetadataService _metadataService;
public MyService(IMetadataService metadataService)
{
_metadataService = metadataService;
}
public async Task<AppObjectResponse?> GetUserProfile(Guid appId, Guid tenantId)
{
return await _metadataClient.GetAppObjectAsync(
appId,
tenantId,
"UserProfile",
version: "1.2.0" // optional
);
}
}
Task<AppObject?> GetAppObjectAsync(
Guid applicationId,
Guid tenantId,
string appObjectName,
string? version = null,
CancellationToken cancellationToken = default)Retrieves an app object by name with optional version filtering.
public class AppObject
{
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; }
}| Option | Type | Default | Description |
|---|---|---|---|
BaseUrl | string | - | Required. Base URL of the metadata service |
TimeoutInSeconds | int | 30 | HTTP request timeout in seconds |
RetryCount | int | 3 | Number of retry attempts for failed requests |
The SDK throws MetadataServiceException for service-related errors:
try
{
var request = new GetAppObjectRequest
{
ApplicationId = appId,
TenantId = tenantId,
AppObjectName = "ObjectName"
};
var appObject = await _metadataService.GetAppObjectAsync(request);
}
catch (MetadataServiceException ex)
{
// Handle service errors
Console.WriteLine($"Error: {ex.Message}, Status: {ex.StatusCode}");
}The SDK includes automatic retry functionality using Polly:
The SDK automatically adds required headers:
AppId: Application identifierTenantId: Tenant identifierUser-Agent: SDK identificationThis 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.