TAF.Infra.Contract 1.11.4

dotnet add package TAF.Infra.Contract --version 1.11.4
                    
NuGet\Install-Package TAF.Infra.Contract -Version 1.11.4
                    
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.Infra.Contract" Version="1.11.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TAF.Infra.Contract" Version="1.11.4" />
                    
Directory.Packages.props
<PackageReference Include="TAF.Infra.Contract" />
                    
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.Infra.Contract --version 1.11.4
                    
#r "nuget: TAF.Infra.Contract, 1.11.4"
                    
#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.Infra.Contract@1.11.4
                    
#: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.Infra.Contract&version=1.11.4
                    
Install as a Cake Addin
#tool nuget:?package=TAF.Infra.Contract&version=1.11.4
                    
Install as a Cake Tool

TAF.Infra.Contract

A comprehensive contract library that provides common models, interfaces, and data structures for the TAF Infrastructure ecosystem. This package contains shared DTOs, enums, base classes, and contract definitions that ensure consistency across all TAF microservices and applications.

๐Ÿš€ Features

  • Shared Data Models: Common DTOs and data structures for inter-service communication
  • Interface Contracts: Standardized interfaces for consistent service implementation
  • Base Classes: Foundational classes for common patterns across services
  • Enum Definitions: Standardized enumeration values for consistent data representation
  • Type Safety: Strongly-typed contracts ensuring compile-time validation
  • Cross-Service Consistency: Unified contracts across the entire TAF ecosystem

๐Ÿ“ฆ Installation

dotnet add package TAF.Infra.Contract

๐Ÿ—ƒ๏ธ What's Included

Data Transfer Objects (DTOs)

  • Common request/response models
  • Shared data structures
  • API contract definitions

Base Classes

  • Base entity classes
  • Common abstract classes
  • Shared implementation patterns

Interfaces

  • Service contract definitions
  • Repository interfaces
  • Common abstractions

Enumerations

  • Status codes
  • Type definitions
  • Configuration constants

๐Ÿš€ Quick Start

1. Installation

Add the package to your project:

dotnet add package TAF.Infra.Contract

2. Using Common Models

using TAF.Infra.Contract.Models;
using TAF.Infra.Contract.Enums;

// Use shared DTOs
public class UserService
{
    public async Task<UserDto> GetUserAsync(Guid userId)
    {
        // Implementation using common contract models
        return new UserDto
        {
            Id = userId,
            Status = UserStatus.Active
        };
    }
}

3. Implementing Common Interfaces

using TAF.Infra.Contract.Interfaces;

// Implement standardized interfaces
public class ProductRepository : IRepository<Product>
{
    public async Task<Product> GetByIdAsync(Guid id)
    {
        // Implementation
    }

    public async Task<IEnumerable<Product>> GetAllAsync()
    {
        // Implementation
    }
}

4. Using Base Classes

using TAF.Infra.Contract.Base;

// Extend from common base classes
public class Product : BaseEntity
{
    public string Name { get; set; }
    public decimal Price { get; set; }

    // BaseEntity provides: Id, CreatedAt, UpdatedAt, etc.
}

๐Ÿ“š Package Structure

Models

  • BaseDto: Common properties for all DTOs
  • ApiResponse<T>: Standardized API response wrapper
  • PaginationRequest: Common pagination parameters
  • PaginationResponse<T>: Paginated response structure

Enums

  • ServiceStatus: Common service status values
  • OperationResult: Standard operation result codes
  • EntityState: Entity lifecycle states

Interfaces

  • IRepository<T>: Generic repository pattern
  • IService<T>: Common service interface
  • IAuditable: Auditing interface for entities

Base Classes

  • BaseEntity: Common entity base class with Id, timestamps
  • BaseService: Common service implementation patterns
  • BaseController: Standard API controller base

๐Ÿ› ๏ธ Best Practices

Model Design

// Always inherit from base classes when appropriate
public class OrderDto : BaseDto
{
    public string OrderNumber { get; set; }
    public OrderStatus Status { get; set; }
    public List<OrderItemDto> Items { get; set; }
}

Interface Implementation

// Use common interfaces for consistency
public class OrderService : IOrderService
{
    public async Task<ApiResponse<OrderDto>> CreateOrderAsync(CreateOrderRequest request)
    {
        // Standardized response format
        return new ApiResponse<OrderDto>
        {
            Success = true,
            Data = createdOrder,
            Message = "Order created successfully"
        };
    }
}

Enum Usage

// Use shared enums for consistency across services
public class Order : BaseEntity
{
    public OrderStatus Status { get; set; } = OrderStatus.Pending;
    public PaymentStatus PaymentStatus { get; set; } = PaymentStatus.Unpaid;
}

๐Ÿ”ง Extending Contracts

Adding New Models

// Follow naming conventions
public class ProductDto : BaseDto
{
    public string Name { get; set; }
    public string Description { get; set; }
    public decimal Price { get; set; }
    public ProductCategory Category { get; set; }
}

Creating Custom Interfaces

// Extend base interfaces when needed
public interface IProductService : IService<Product>
{
    Task<IEnumerable<Product>> GetByCategoryAsync(ProductCategory category);
    Task<bool> UpdatePriceAsync(Guid productId, decimal newPrice);
}

๐Ÿงช Testing Support

The contract library provides:

  • Mock-friendly interfaces
  • Testable base classes
  • Consistent data structures for unit tests
// Easy to mock standardized interfaces
var mockRepository = new Mock<IRepository<Product>>();
mockRepository.Setup(r => r.GetByIdAsync(It.IsAny<Guid>()))
              .ReturnsAsync(new Product { Name = "Test Product" });

๐Ÿ“„ Version Compatibility

This package follows semantic versioning:

  • Major: Breaking changes to contracts
  • Minor: New models, interfaces, or enums (backward compatible)
  • Patch: Bug fixes and documentation updates

๐Ÿค Contributing

When adding new contracts:

  1. Follow existing naming conventions
  2. Add comprehensive documentation
  3. Include usage examples
  4. Ensure backward compatibility
  5. Update version appropriately

๐Ÿ“„ License

This project is licensed under the MIT License.

๐Ÿ› Issues

If you encounter any issues, please file them in the GitHub Issues section.


Built with โค๏ธ for consistent microservices architecture

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.
  • net8.0

    • No dependencies.

NuGet packages (14)

Showing the top 5 NuGet packages that depend on TAF.Infra.Contract:

Package Downloads
TAF.MetaData.SDK

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.

TAF.Infra.MassTransit

A comprehensive abstraction layer over MediatR and MassTransit that provides unified Command, Query, and Event handling patterns with support for both local (in-process) and distributed (message broker) execution. Features include CQRS pattern implementation, context-aware messaging, multi-tenant support, automatic handler registration, and support for multiple message brokers (RabbitMQ, Azure Service Bus, Amazon SQS).

TAF.CRUD.SDK

Official SDK for consuming TAF.CRUD microservice. v6.0.6: Trigger field-criteria now skips fields absent from UPDATE payloads โ€” prevents false "changed to null" detections when the caller didn't touch a selected field.

TAF.Infra.QueryHook

A common interface library for QueryHook functionality that provides a standardized contract for performing configured actions. Enables consistent implementation of query hook patterns across different services and applications with configurable action execution.

TAF.Infra.WorkflowAction

Workflow Action abstractions, models, attributes, and helpers for TAF platform. Provides IWorkflowAction interface, ActionContext, ActionDefinition, ActionResult, and validation helpers for building workflow actions and transition hooks. ActionContext now includes OldRecordData โ€” a pre-update snapshot of the record that fired the trigger, enabling custom actions to compare old vs new field values on Edit events.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.11.4 28 5/4/2026
1.11.3 258 4/15/2026
1.11.2 178 3/27/2026
1.11.1 96 3/27/2026
1.11.0 136 3/19/2026
1.10.15 210 3/10/2026
1.10.14 93 3/7/2026
1.10.13 103 3/5/2026
1.10.12 99 3/5/2026
1.10.11 181 3/5/2026
1.10.10 406 2/10/2026
1.10.9 112 1/31/2026
1.10.8 893 1/21/2026
1.10.6 157 1/13/2026
1.10.5 1,070 12/17/2025
1.10.4 543 12/10/2025
1.10.3 485 12/9/2025
1.10.2 578 12/5/2025
1.10.0 264 11/27/2025
1.9.2 382 11/11/2025
Loading failed

v1.11.4: Stabilized default Id on Filter and SortCriteria
- Filter.Id and SortCriteria.Id no longer initialize to Guid.NewGuid() by default
- Default is now Guid.Empty so identical filter/sort definitions serialize to identical JSON
- Fixes metadata diff false-positive where every AppObject containing LookUpDetails appeared as Updated, because filter Ids drifted on every UpsertVersionAsync rebuild
- No breaking changes โ€” nothing in CRUD or metadata reads the Id semantically; existing stored JSON keeps its original Id on deserialize

v1.11.3: Added DataAccessSet enum
- Added Enums/DataAccessSet.cs with NONE=1, OWN=2, TEAM=3, ALL=4
- Defines permission scope levels for TABD_AppObjectAccess rows
- Used by Metadata Service when seeding default role permissions on AppObject registration
- No breaking changes - additive only

v1.11.1: Added CascadeDelete property to ChildRelationship
- Added CascadeDelete boolean property (default: false) to control soft-delete cascade behavior
- false: Block soft-delete if children exist (prevents orphaned records)
- true: Cascade soft-delete to children (if child supports soft-delete)
- Enables per-relationship cascade control for SoftDeleteCascadeHook in taf_crud
- No breaking changes - additive only

v1.11.0: Added StatusTransitionResponse DTOs for blueprint status operations
- Added DTOs/StatusTransitionResponse.cs โ€” Shared response model for status transitions (replaces GetNextAvailableStatusResponse in Blueprint.SDK)
- Added AvailableTransition class โ€” Individual transition with optional hook data (replaces ToStatusResponse in Blueprint.SDK)
- Hook properties use object? to avoid circular dependency with TAF.Infra.WorkflowAction
- Enables CRUD SDK to expose status operations without Blueprint.SDK dependency
- No breaking changes - additive only

v1.10.14: Removed ObjectID_Tosave property from Field
- Removed unused ObjectID_Tosave property from field model
- Added User field type constant (25) to FieldTypeConstants
- No breaking changes for consumers not using ObjectID_Tosave

v1.10.13: Added CustomScriptType enum
- Added Enums/CustomScriptType.cs with QueryHook=1, WorkflowAction=2, CustomValidator=7, TransitionStart=11
- Enables consistent custom script type definitions across TAF microservices
- No breaking changes - additive only

v1.10.9: Added Space filtering flags and XML documentation for AppObject
- Added IsSpaceAgnostic flag - Excludes generic/polymorphic child tables (Comments, Attachments, Activities) from Space filtering
- Added IsSpaceRoot flag - Marks AppObjects as Space roots for LookupPathFinder filtering
- Added XML documentation comments for feature flags: EnableTracking, AllowSearchable, AllowSharing, AllowVersioning, IsSupportBluePrint, AllowSoftDelete, IsCacheEnable, IsSupportLayout, IsDeprecated, EnableComment
- No breaking changes - additive only

v1.10.8: Patch version release
- Minor updates and improvements
- No breaking changes

v1.10.7: Patch version release
- Minor updates and improvements
- No breaking changes

v1.10.6: Patch version release
- Minor updates and improvements
- No breaking changes

v1.10.5: Patch version release
- Minor updates and improvements
- No breaking changes

v1.10.4: Moved Error functions to ErrorHandling
- Removed Error functions from Error.cs and moved to ErrorHandling

v1.10.3: Maintenance release with latest changes from dev branch
- Synchronized with latest infrastructure updates
- No breaking changes - maintenance release

v1.10.2: Added comprehensive metadata models for AppObject and Field definitions
- Added Models/Metadata/AppObjectDefinition.cs - Full-featured base class with all infrastructure properties
- Added Models/Metadata/FieldDefinition.cs - Complete field metadata with validation, constraints, and relationships
- Added Models/Metadata/RecordInfo.cs - Audit metadata for record tracking
- Added Models/Metadata/ChildRelationship.cs - Parent-child relationship definitions
- Supporting classes: FieldTypeInfo, LookupDefinition, FieldConfiguration, Filter, SelectQueryDefinition, WhereClause
- Enables consistent metadata structure across CRUD and other microservices
- No breaking changes - additive only (existing AppObject class unchanged)

v1.10.1: Added AppObject metadata model
- Added Models/Metadata/AppObject.cs - New model for representing application objects in metadata
- Extends metadata capabilities for application object management
- No breaking changes - additive only

v1.10.0: Added CorrelationId to OperationResult
- Added CorrelationId property to both OperationResult and OperationResult<T>
- Enables request tracing across microservices
- Used for matching async responses to original requests
- Consistent response format for unified endpoint pattern (200 OK / 202 Accepted)

v1.9.2: Added bulk insert enum support
- Added new enum for bulk insert operations
- Enables standardized bulk insert patterns across TAF services
- No breaking changes - additive only

v1.9.1: Same as v1.9.2 (use v1.9.2 for latest features)

v1.9.0: Same as v1.8.0

v1.8.0: Removed redundant IsFailure property (republish)
- BREAKING CHANGE: Removed IsFailure computed property from OperationResult
- Use !IsSuccess instead of IsFailure for checking failure state
- Simplifies API surface and reduces property count
- Updated internal Error property getter to use !IsSuccess
- Updated ErrorForSerialization getter to use !IsSuccess
- Fresh build to ensure all consumers get updated version

v1.7.0: Same as v1.8.0 (use v1.8.0 instead)

v1.6.0: Added centralized OperationResult and Error classes
- Added Results/OperationResult.cs - Generic and non-generic versions for consistent API responses
- Added Results/Error.cs - Immutable error object with factory methods (Validation, NotFound, etc.)
- Includes ExecutionTimeMs, Logs, Metadata tracking for all operations
- Includes AffectedRecords, TotalRecords properties (nullable, for CRUD operations)
- Cleaned up implementation - removed unused functional methods (Match, Map, Bind)
- JSON deserialization support with parameterless constructor and mutable properties
- Shared across all TAF microservices for unified error handling and response structure
- No breaking changes - additive only (new namespace: TAF.Infra.Contract.Results)

v1.5.1: ConnectionConfig property alignment with legacy database
- Renamed ConnectionConfig.Database โ†’ DBName to match legacy tabmd_connections JSON structure
- Renamed ConnectionConfig.Username โ†’ UserName to match legacy tabmd_connections JSON structure
- Changed ConnectionConfig.Port type from int โ†’ string to match legacy tabmd_connections JSON structure
- Ensures proper deserialization of existing connection configuration data
- No breaking changes for new implementations - backward compatible with old database JSON

v1.5.0: Added generic connection models
- Added Models/Connection.cs - Generic connection model aligned with tabmd_connections schema
- Added Models/ConnectionConfig.cs - Configuration structure for connection details
- Added Constants/ConnectorTypeConstants.cs - Guid constants for SQL Server and PostgreSQL
- Connection model includes TabCompatible field and uses nullable types per database schema
- Enables consistent connection management across Metadata and CRUD microservices
- No breaking changes - additive only

v1.4.0: Added shared caching interface
- Added Caching folder with ICacheService interface for cache abstraction
- Enables consistent caching pattern across all TAF microservices
- No breaking changes - additive only

v1.3.0: Added Filter and FilterCriteria contracts
- Added DTOs folder with Filter and FilterCriteria classes for shared filtering across microservices
- Added Enums folder with ConjunctionClause, FilterType, FilterValueType, RelationalOperator
- FilterCriteria now available as shared contract across all TAF services
- Breaking change: Upgrade TAF.Infra.QueryHook to use FilterCriteria in HookContext.WhereClause