TAF.MetaData.SDK 2.0.1

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TAF.MetaData.SDK" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TAF.MetaData.SDK" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="TAF.MetaData.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TAF.MetaData.SDK --version 2.0.1
                    
#r "nuget: TAF.MetaData.SDK, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TAF.MetaData.SDK@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TAF.MetaData.SDK&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=TAF.MetaData.SDK&version=2.0.1
                    
Install as a Cake Tool

TAF Metadata Service SDK

NuGet Version .NET

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 identifier
  • TenantId: Tenant identifier
  • User-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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
4.1.0 207 9/19/2025
3.0.1 138 9/5/2025
3.0.0 115 9/5/2025
2.0.2 140 9/3/2025
2.0.1 135 9/3/2025
1.0.0 138 9/3/2025