Browse Source

CommandBus WIP

pull/223/head
Eduard Tomas 7 years ago
parent
commit
5ae7350b81
4 changed files with 46 additions and 0 deletions
  1. +8
    -0
      src/BuildingBlocks/CommandBus/CommandBus/CommandBus.csproj
  2. +13
    -0
      src/BuildingBlocks/CommandBus/CommandBus/ICommandBus.cs
  3. +18
    -0
      src/BuildingBlocks/CommandBus/CommandBus/IntegrationCommand.cs
  4. +7
    -0
      src/BuildingBlocks/CommandBus/CommandBusRabbitMQ/CommandBusRabbitMQ.csproj

+ 8
- 0
src/BuildingBlocks/CommandBus/CommandBus/CommandBus.csproj View File

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.CommandBus</RootNamespace>
</PropertyGroup>
</Project>

+ 13
- 0
src/BuildingBlocks/CommandBus/CommandBus/ICommandBus.cs View File

@ -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>(T command) where T : IntegrationCommand;
}
}

+ 18
- 0
src/BuildingBlocks/CommandBus/CommandBus/IntegrationCommand.cs View File

@ -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;
}
}
}

+ 7
- 0
src/BuildingBlocks/CommandBus/CommandBusRabbitMQ/CommandBusRabbitMQ.csproj View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>
</Project>

Loading…
Cancel
Save