TAF.Infra.Contract
1.10.10
dotnet add package TAF.Infra.Contract --version 1.10.10
NuGet\Install-Package TAF.Infra.Contract -Version 1.10.10
<PackageReference Include="TAF.Infra.Contract" Version="1.10.10" />
<PackageVersion Include="TAF.Infra.Contract" Version="1.10.10" />
<PackageReference Include="TAF.Infra.Contract" />
paket add TAF.Infra.Contract --version 1.10.10
#r "nuget: TAF.Infra.Contract, 1.10.10"
#:package TAF.Infra.Contract@1.10.10
#addin nuget:?package=TAF.Infra.Contract&version=1.10.10
#tool nuget:?package=TAF.Infra.Contract&version=1.10.10
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:
- Follow existing naming conventions
- Add comprehensive documentation
- Include usage examples
- Ensure backward compatibility
- 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 | 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
- No dependencies.
NuGet packages (11)
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.0: BREAKING - All CUD operations now return List<Guid> instead of mixed types (Guid for Insert/Update, int for Delete). ExecuteAsync, UpdateAsync, DeleteAsync all return List<Guid>. Detailed methods return ProcessedResponse<List<Guid>>. Events use Result (List<Guid>) instead of RecordId (Guid). |
|
|
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.Kibana.SDK
Professional SDK for TAF Kibana logging and analytics platform. Features working create-log endpoint, fluent API, Clean Architecture, SOLID principles, comprehensive error handling with retry logic and exponential backoff. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.10.10 | 266 | 2/10/2026 |
| 1.10.9 | 101 | 1/31/2026 |
| 1.10.8 | 376 | 1/21/2026 |
| 1.10.6 | 133 | 1/13/2026 |
| 1.10.5 | 907 | 12/17/2025 |
| 1.10.4 | 519 | 12/10/2025 |
| 1.10.3 | 466 | 12/9/2025 |
| 1.10.2 | 425 | 12/5/2025 |
| 1.10.0 | 252 | 11/27/2025 |
| 1.9.2 | 369 | 11/11/2025 |
| 1.9.1 | 284 | 11/11/2025 |
| 1.9.0 | 352 | 11/3/2025 |
| 1.5.1 | 173 | 10/25/2025 |
| 1.5.0 | 267 | 10/24/2025 |
| 1.4.1 | 202 | 10/23/2025 |
| 1.4.0 | 186 | 10/23/2025 |
| 1.3.0 | 690 | 10/14/2025 |
| 1.2.0 | 210 | 10/13/2025 |
| 1.1.0 | 263 | 10/8/2025 |
| 1.0.0 | 530 | 9/24/2025 |
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