TAF.MetaData.SDK
2.0.1
See the version list below for details.
dotnet add package TAF.MetaData.SDK --version 2.0.1
NuGet\Install-Package TAF.MetaData.SDK -Version 2.0.1
<PackageReference Include="TAF.MetaData.SDK" Version="2.0.1" />
<PackageVersion Include="TAF.MetaData.SDK" Version="2.0.1" />
<PackageReference Include="TAF.MetaData.SDK" />
paket add TAF.MetaData.SDK --version 2.0.1
#r "nuget: TAF.MetaData.SDK, 2.0.1"
#:package TAF.MetaData.SDK@2.0.1
#addin nuget:?package=TAF.MetaData.SDK&version=2.0.1
#tool nuget:?package=TAF.MetaData.SDK&version=2.0.1
TAF Metadata Service SDK
A 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.
Features
✅ 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
Installation
dotnet add package TAF.MetaData.SDK
Quick Start
1. Configuration
Add the metadata service configuration to your appsettings.json
:
{
"MetadataService": {
"BaseUrl": "https://your-metadata-service.com",
"TimeoutInSeconds": 30,
"RetryCount": 3
}
}
2. Service Registration
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;
});
3. Usage
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
);
}
}
API Reference
IMetadataService
GetAppObjectAsync
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.
Response Models
AppObject
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; }
}
Configuration Options
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 |
Error Handling
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}");
}
Retry Policy
The SDK includes automatic retry functionality using Polly:
- Exponential backoff strategy
- Configurable retry count
- Handles transient HTTP errors
Headers
The SDK automatically adds required headers:
AppId
: Application identifierTenantId
: Tenant identifierUser-Agent
: SDK identification
Dependencies
- .NET 8.0+
- Microsoft.Extensions.Http
- Microsoft.Extensions.Options.ConfigurationExtensions
- System.Text.Json
- Polly (for retry policies)
Contributing
This SDK is maintained by the TAF Development Team. For issues or feature requests, please contact the development team.
License
MIT License - see LICENSE file for details.
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.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Http.Polly (>= 8.0.8)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 8.0.0)
- Polly (>= 7.2.4)
- Polly.Extensions.Http (>= 3.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.