diff --git a/src/BuildingBlocks/CommandBus/CommandBus/CommandBus.csproj b/src/BuildingBlocks/CommandBus/CommandBus/CommandBus.csproj new file mode 100644 index 000000000..ae05359a1 --- /dev/null +++ b/src/BuildingBlocks/CommandBus/CommandBus/CommandBus.csproj @@ -0,0 +1,8 @@ + + + + netstandard1.4 + Microsoft.eShopOnContainers.BuildingBlocks.CommandBus + + + \ No newline at end of file diff --git a/src/BuildingBlocks/CommandBus/CommandBus/ICommandBus.cs b/src/BuildingBlocks/CommandBus/CommandBus/ICommandBus.cs new file mode 100644 index 000000000..2092e11b0 --- /dev/null +++ b/src/BuildingBlocks/CommandBus/CommandBus/ICommandBus.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.BuildingBlocks.CommandBus +{ + public interface ICommandBus + { + Task SendAsync(T command) where T : IntegrationCommand; + + } +} diff --git a/src/BuildingBlocks/CommandBus/CommandBus/IntegrationCommand.cs b/src/BuildingBlocks/CommandBus/CommandBus/IntegrationCommand.cs new file mode 100644 index 000000000..36f1f0fdc --- /dev/null +++ b/src/BuildingBlocks/CommandBus/CommandBus/IntegrationCommand.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.eShopOnContainers.BuildingBlocks.CommandBus +{ + public abstract class IntegrationCommand + { + public Guid Id { get; private set; } + public DateTime Sent { get; private set; } + + protected IntegrationCommand() + { + Id = Guid.NewGuid(); + Sent = DateTime.UtcNow; + } + } +} diff --git a/src/BuildingBlocks/CommandBus/CommandBusRabbitMQ/CommandBusRabbitMQ.csproj b/src/BuildingBlocks/CommandBus/CommandBusRabbitMQ/CommandBusRabbitMQ.csproj new file mode 100644 index 000000000..954020d10 --- /dev/null +++ b/src/BuildingBlocks/CommandBus/CommandBusRabbitMQ/CommandBusRabbitMQ.csproj @@ -0,0 +1,7 @@ + + + + netstandard1.4 + + + \ No newline at end of file