Shared kernel building blocks for TiqriGlobalShop services: Result pattern, Error types, Entity base class, domain event contracts, and common abstractions.
$ dotnet add package TiqriGlobalShop.Common.SharedKernelShared kernel building blocks for GlobalShop services.
Result Pattern — Railway-oriented error handling
Result / Result<T> — Success/failure types with railway semanticsError — Strongly-typed error record with code, description, and classificationErrorType — Enum for mapping errors to HTTP status codes (Validation, NotFound, Conflict, etc.)ValidationError — Aggregates multiple field-level errorsDomain Primitives
Entity — Base class with domain event support (PublishEvent, ClearDomainEvents)IDomainEvent — Marker interface for domain eventsIDomainEventHandler<T> — Handler contract for domain eventsIDateTimeProvider — Abstraction for testable date/time accessdotnet add package GlobalShop.Common.SharedKernel
using GlobalShop.Inventory.SharedKernel;
// Return success
Result<Product> result = product;
// Return failure
return Result.Failure<Product>(Error.NotFound("Product.NotFound", "Product not found"));
// Aggregate validation errors
var validationError = ValidationError.FromResults(validationResults);
Types in this package use the GlobalShop.Inventory.SharedKernel namespace for backward compatibility
with existing consumers. A future major version may transition to GlobalShop.Common.SharedKernel.
MIT