Erp.Shared.Contracts
1.1.3
dotnet add package Erp.Shared.Contracts --version 1.1.3
NuGet\Install-Package Erp.Shared.Contracts -Version 1.1.3
<PackageReference Include="Erp.Shared.Contracts" Version="1.1.3" />
<PackageVersion Include="Erp.Shared.Contracts" Version="1.1.3" />
<PackageReference Include="Erp.Shared.Contracts" />
paket add Erp.Shared.Contracts --version 1.1.3
#r "nuget: Erp.Shared.Contracts, 1.1.3"
#:package Erp.Shared.Contracts@1.1.3
#addin nuget:?package=Erp.Shared.Contracts&version=1.1.3
#tool nuget:?package=Erp.Shared.Contracts&version=1.1.3
Erp.Shared.Contracts
Shared DTOs, interfaces, and contracts for ERP microservices architecture with MassTransit integration support.
Version
Current Version: 1.1.0
Features
- DataMessage DTO: Generic message structure for cross-service communication
- IIntegrationEventPublisher: Interface for publishing integration events across microservices
- IntegrationEventPublisher: MassTransit-based implementation for event publishing
- Shared DTOs: Common data transfer objects used across multiple services
Installation
dotnet add package Erp.Shared.Contracts --version 1.1.0
Usage
Publishing Integration Events
using Shared.Contracts.Common;
using Microsoft.Extensions.DependencyInjection;
// In your Program.cs or Startup.cs
services.AddScoped<IIntegrationEventPublisher, IntegrationEventPublisher>();
// In your service class
public class MyService
{
private readonly IIntegrationEventPublisher _publisher;
public MyService(IIntegrationEventPublisher publisher)
{
_publisher = publisher;
}
public async Task PublishCompanyCreatedEvent(Company company)
{
await _publisher.PublishAsync(
entityType: "Company",
operation: "Created",
payload: new {
CompanyId = company.Id,
Name = company.Name
},
source: "IdentityService");
}
}
Using DataMessage
using Shared.Contracts.Common;
var message = new DataMessage
{
EntityType = "Company",
Operation = "Created",
Source = "IdentityService",
Timestamp = DateTime.UtcNow,
Data = JsonSerializer.Serialize(payload)
};
What's New in v1.1.0
- Added
IIntegrationEventPublisherinterface for standardized event publishing - Added
IntegrationEventPublisherimplementation using MassTransit - Generic event publishing support through
DataMessageDTO - MassTransit dependency for message broker integration
Dependencies
- .NET 9.0
- MassTransit 8.2.0
Related Packages
- Erp.Shared.API: Shared API infrastructure and extensions
- Erp.Shared.Infrastructure: Shared infrastructure components
License
MIT
Support
For issues and feature requests, please visit the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
-
net9.0
- MassTransit (>= 8.2.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Erp.Shared.Contracts:
| Package | Downloads |
|---|---|
|
Erp.Shared.API
Shared API components and extensions for ERP microservices including service registration, middleware, API versioning, and MassTransit integration event publisher registration. |
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.1.0:
- Added IIntegrationEventPublisher interface for cross-service event publishing
- Added IntegrationEventPublisher implementation using MassTransit
- Added support for generic event publishing with DataMessage DTO
- Added MassTransit dependency