diff --git a/Test.RabbitMq.Shop.Api/Controllers/OrderController.cs b/Test.RabbitMq.Shop.Api/Controllers/OrderController.cs index 8fb0d2e..78e74c5 100644 --- a/Test.RabbitMq.Shop.Api/Controllers/OrderController.cs +++ b/Test.RabbitMq.Shop.Api/Controllers/OrderController.cs @@ -1,5 +1,6 @@ using MassTransit; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; using Test.RabbitMq.Shop.Api.Helpers; using Test.RabbitMq.Shop.Api.Models; using Test.RabbitMq.Shop.Common.Messages; @@ -16,13 +17,17 @@ public class OrderController : ControllerBase private readonly IOrderRepository _orderRepository; private readonly IProductRepository _productRepository; private readonly IPublishEndpoint _publishEndpoint; + private readonly IBus _bus; + private readonly ISendEndpointProvider _sendEndpointProvider; - public OrderController(ILogger logger, IOrderRepository orderRepository, IProductRepository productRepository, IPublishEndpoint publishEndpoint) + public OrderController(ILogger logger, IOrderRepository orderRepository, IProductRepository productRepository, IPublishEndpoint publishEndpoint, ISendEndpointProvider sendEndpointProvider, IBus bus) { _logger = logger; _orderRepository = orderRepository; _productRepository = productRepository; _publishEndpoint = publishEndpoint; + _sendEndpointProvider = sendEndpointProvider; + _bus = bus; } [HttpGet] @@ -38,7 +43,7 @@ public ActionResult> Get() } [HttpPost] - public ActionResult Post(CreateOrderModel model) + public async Task Post(CreateOrderModel model) { var product = _productRepository.GetProduct(model.ProductId); if (product == null) @@ -57,15 +62,16 @@ public ActionResult Post(CreateOrderModel model) _orderRepository.AddOrder(newOrder); _logger.LogInformation($"Order {newOrder.Id} added"); - - _publishEndpoint.Publish(new OrderCreatedEvent( - Guid.NewGuid(), + + var message = new OrderCreatedEvent( newOrder.Id, - product.Id, - model.ProductQuantity, - newOrder.OrderPrice)); + product.Id, + model.ProductQuantity, + newOrder.OrderPrice); + + await _publishEndpoint.Publish(message); - _logger.LogInformation($"OrderCreatedEvent message published"); + _logger.LogWarning($"OrderCreatedEvent message published: {JsonConvert.SerializeObject(message)}"); return Ok(); } diff --git a/Test.RabbitMq.Shop.Api/Program.cs b/Test.RabbitMq.Shop.Api/Program.cs index ee46152..ab2b97a 100644 --- a/Test.RabbitMq.Shop.Api/Program.cs +++ b/Test.RabbitMq.Shop.Api/Program.cs @@ -9,13 +9,16 @@ builder.Services.AddMassTransit(x => { x.SetKebabCaseEndpointNameFormatter(); - x.UsingRabbitMq((context, cfg) => + + x.UsingRabbitMq((ctx, cfg) => { cfg.Host("localhost", "/", h => { h.Username("guest"); h.Password("guest"); }); + + cfg.UseMessageRetry(r => r.Interval(3, 1000)); }); }); diff --git a/Test.RabbitMq.Shop.Api/Test.RabbitMq.Shop.Api.csproj b/Test.RabbitMq.Shop.Api/Test.RabbitMq.Shop.Api.csproj index 99aad18..642eb0d 100644 --- a/Test.RabbitMq.Shop.Api/Test.RabbitMq.Shop.Api.csproj +++ b/Test.RabbitMq.Shop.Api/Test.RabbitMq.Shop.Api.csproj @@ -9,6 +9,7 @@ + @@ -20,6 +21,7 @@ + diff --git a/Test.RabbitMq.Shop.Common.NotificationService/Consumers/NotificationSentConsumer.cs b/Test.RabbitMq.Shop.Common.NotificationService/Consumers/CheckNotificationConsumer.cs similarity index 51% rename from Test.RabbitMq.Shop.Common.NotificationService/Consumers/NotificationSentConsumer.cs rename to Test.RabbitMq.Shop.Common.NotificationService/Consumers/CheckNotificationConsumer.cs index 3ae62ff..65090e1 100644 --- a/Test.RabbitMq.Shop.Common.NotificationService/Consumers/NotificationSentConsumer.cs +++ b/Test.RabbitMq.Shop.Common.NotificationService/Consumers/CheckNotificationConsumer.cs @@ -4,23 +4,23 @@ namespace Test.RabbitMq.Shop.Common.NotificationService.Consumers; -public class NotificationSentConsumer : IConsumer +public class CheckNotificationConsumer : IConsumer { - private readonly ILogger _logger; + private readonly ILogger _logger; - public NotificationSentConsumer(ILogger logger) + public CheckNotificationConsumer(ILogger logger) { _logger = logger; } - public Task Consume(ConsumeContext context) + public Task Consume(ConsumeContext context) { var message = context.Message; var jsonMessage = JsonConvert.SerializeObject(message); - _logger.LogInformation($"NotificationSentConsumer message: {jsonMessage}"); + _logger.LogInformation($"ICheckNotificationEvent message: {jsonMessage}"); - // simulate receiving an email + // simulated email verification _logger.LogWarning("Notification message was received"); return Task.CompletedTask; diff --git a/Test.RabbitMq.Shop.Common.NotificationService/Consumers/OrderCreatedConsumer.cs b/Test.RabbitMq.Shop.Common.NotificationService/Consumers/OrderCreatedConsumer.cs deleted file mode 100644 index 6a00a7b..0000000 --- a/Test.RabbitMq.Shop.Common.NotificationService/Consumers/OrderCreatedConsumer.cs +++ /dev/null @@ -1,32 +0,0 @@ -using MassTransit; -using Newtonsoft.Json; -using Test.RabbitMq.Shop.Common.Messages; - -namespace Test.RabbitMq.Shop.Common.NotificationService.Consumers; - -public class OrderCreatedConsumer : IConsumer -{ - private readonly IPublishEndpoint _publishEndpoint; - private readonly ILogger _logger; - - public OrderCreatedConsumer(IPublishEndpoint publishEndpoint, ILogger logger) - { - _publishEndpoint = publishEndpoint; - _logger = logger; - } - - public Task Consume(ConsumeContext context) - { - var message = context.Message; - var jsonMessage = JsonConvert.SerializeObject(message); - - _logger.LogInformation($"OrderCreatedEvent message: {jsonMessage}"); - - // imitation of sending an email - _logger.LogWarning($"Notification on email: {DateTime.Now:G} - Order {message.OrderId}"); - - _publishEndpoint.Publish(new NotificationSentEvent(message.CorrelationId, message.OrderId)); - - return Task.CompletedTask; - } -} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common.NotificationService/Consumers/SendNotificationConsumer.cs b/Test.RabbitMq.Shop.Common.NotificationService/Consumers/SendNotificationConsumer.cs new file mode 100644 index 0000000..df1d3d2 --- /dev/null +++ b/Test.RabbitMq.Shop.Common.NotificationService/Consumers/SendNotificationConsumer.cs @@ -0,0 +1,52 @@ +using MassTransit; +using Newtonsoft.Json; +using Test.RabbitMq.Shop.Common.Messages; + +namespace Test.RabbitMq.Shop.Common.NotificationService.Consumers; + +public class SendNotificationConsumer : IConsumer +{ + private readonly ISendEndpointProvider _sendEndpointProvider; + private readonly ILogger _logger; + + public SendNotificationConsumer(ILogger logger, ISendEndpointProvider sendEndpointProvider) + { + _logger = logger; + _sendEndpointProvider = sendEndpointProvider; + } + + public async Task Consume(ConsumeContext context) + { + var message = context.Message; + var jsonMessage = JsonConvert.SerializeObject(message); + + _logger.LogInformation($"ISendNotificationEvent message: {jsonMessage}"); + + // imitation of sending an email + _logger.LogWarning($"Notification on email: {DateTime.Now:G} - Order {message.OrderId}"); + + var sendEndpoint = await _sendEndpointProvider.GetSendEndpoint( + new Uri($"queue:{QueueNames.OrderSagaQueueName}")); + + if (IsSuccessUsingDnD()) + { + await sendEndpoint.Send(new NotificationSentEvent(message.CorrelationId, message.OrderId)); + } + else + { + throw new Exception("Failed because DnD"); + } + } + + // gamification of successful notification sending + private bool IsSuccessUsingDnD() + { + const int check = 11; + var d20dice = new Random(); + var roll = d20dice.Next(1, 21); + + _logger.LogWarning($"DND: Notification success ({check}) roll - {roll}"); + + return roll >= check; + } +} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common.NotificationService/Program.cs b/Test.RabbitMq.Shop.Common.NotificationService/Program.cs index 53e18d4..e887c48 100644 --- a/Test.RabbitMq.Shop.Common.NotificationService/Program.cs +++ b/Test.RabbitMq.Shop.Common.NotificationService/Program.cs @@ -1,4 +1,5 @@ using MassTransit; +using Test.RabbitMq.Shop.Common; using Test.RabbitMq.Shop.Common.NotificationService.Consumers; var builder = WebApplication.CreateBuilder(args); @@ -6,9 +7,9 @@ builder.Services.AddMassTransit(x => { x.SetKebabCaseEndpointNameFormatter(); - - x.AddConsumer(); - x.AddConsumer(); + + x.AddConsumer(); + x.AddConsumer(); x.UsingRabbitMq((context, cfg) => { @@ -17,11 +18,13 @@ h.Username("guest"); h.Password("guest"); }); - - cfg.ReceiveEndpoint("order_saga", c => + + cfg.ReceiveEndpoint(QueueNames.NotificationQueueName, c => { - c.ConfigureConsumer(context); - c.ConfigureConsumer(context); + c.UseMessageRetry(r => r.Interval(3, 1000)); + + c.ConfigureConsumer(context); + c.ConfigureConsumer(context); }); }); }); diff --git a/Test.RabbitMq.Shop.Common.NotificationService/Test.RabbitMq.Shop.Common.NotificationService.csproj b/Test.RabbitMq.Shop.Common.NotificationService/Test.RabbitMq.Shop.Common.NotificationService.csproj index e20a5f1..715263a 100644 --- a/Test.RabbitMq.Shop.Common.NotificationService/Test.RabbitMq.Shop.Common.NotificationService.csproj +++ b/Test.RabbitMq.Shop.Common.NotificationService/Test.RabbitMq.Shop.Common.NotificationService.csproj @@ -15,8 +15,8 @@ - - + + diff --git a/Test.RabbitMq.Shop.Common.StateMachineService/Dockerfile b/Test.RabbitMq.Shop.Common.StateMachineService/Dockerfile new file mode 100644 index 0000000..b329f88 --- /dev/null +++ b/Test.RabbitMq.Shop.Common.StateMachineService/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["Test.RabbitMq.Shop.Common.StateMachineService/Test.RabbitMq.Shop.Common.StateMachineService.csproj", "Test.RabbitMq.Shop.Common.StateMachineService/"] +RUN dotnet restore "Test.RabbitMq.Shop.Common.StateMachineService/Test.RabbitMq.Shop.Common.StateMachineService.csproj" +COPY . . +WORKDIR "/src/Test.RabbitMq.Shop.Common.StateMachineService" +RUN dotnet build "Test.RabbitMq.Shop.Common.StateMachineService.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Test.RabbitMq.Shop.Common.StateMachineService.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Test.RabbitMq.Shop.Common.StateMachineService.dll"] diff --git a/Test.RabbitMq.Shop.Common.StateMachineService/OrderState.cs b/Test.RabbitMq.Shop.Common.StateMachineService/OrderState.cs new file mode 100644 index 0000000..068ceba --- /dev/null +++ b/Test.RabbitMq.Shop.Common.StateMachineService/OrderState.cs @@ -0,0 +1,10 @@ +using MassTransit; + +namespace Test.RabbitMq.Shop.Common.StateMachineService; + +public class OrderState : SagaStateMachineInstance +{ + public Guid CorrelationId { get; set; } + public Guid OrderId { get; set; } + public string CurrentState { get; set; } +} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common.StateMachineService/OrderStateMachine.cs b/Test.RabbitMq.Shop.Common.StateMachineService/OrderStateMachine.cs new file mode 100644 index 0000000..615be33 --- /dev/null +++ b/Test.RabbitMq.Shop.Common.StateMachineService/OrderStateMachine.cs @@ -0,0 +1,57 @@ +using MassTransit; +using Newtonsoft.Json; +using Test.RabbitMq.Shop.Common.Messages; + +namespace Test.RabbitMq.Shop.Common.StateMachineService; + +public class OrderStateMachine : MassTransitStateMachine +{ + private readonly ILogger _logger; + + public Event OrderCreatedEvent { get; set; } + public Event NotificationSentEvent { get; set; } + public Event> SendNotificationFaultEvent { get; set; } + + public State OrderCreated { get; set; } + public State SendNotificationFault { get; set; } + public State NotificationSent { get; set; } + + public OrderStateMachine(ILogger logger) + { + _logger = logger; + InstanceState(x => x.CurrentState); + + Event(() => OrderCreatedEvent); + Event(() => NotificationSentEvent); + Event(() => SendNotificationFaultEvent, + x => x.CorrelateById( + ctx => ctx.InitiatorId ?? ctx.Message.Message.CorrelationId)); + + Initially( + When(OrderCreatedEvent) + .Then(ctx => + _logger.LogWarning($"OrderCreatedEvent message: {JsonConvert.SerializeObject(ctx.Message)}")) + .Then(ctx => ctx.Saga.OrderId = ctx.Message.OrderId) + .Send(new Uri($"queue:{QueueNames.NotificationQueueName}"), + ctx => + new SendNotificationEvent(ctx.Saga.CorrelationId, ctx.Message.OrderId)) + .TransitionTo(OrderCreated)); + + During(OrderCreated, + When(SendNotificationFaultEvent) + .Then(ctx => + _logger.LogError( + $"SendNotificationFaultEvent message: {JsonConvert.SerializeObject(ctx.Message)}")) + .TransitionTo(SendNotificationFault)); + + During(OrderCreated, + When(NotificationSentEvent) + .Then(ctx => + _logger.LogWarning($"NotificationSentEvent message: {JsonConvert.SerializeObject(ctx.Message)}")) + .Send(new Uri($"queue:{QueueNames.NotificationQueueName}"), + ctx => + new CheckNotificationEvent(ctx.Saga.CorrelationId, ctx.Message.OrderId)) + .TransitionTo(NotificationSent) + .Finalize()); + } +} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common.StateMachineService/Program.cs b/Test.RabbitMq.Shop.Common.StateMachineService/Program.cs new file mode 100644 index 0000000..64b4272 --- /dev/null +++ b/Test.RabbitMq.Shop.Common.StateMachineService/Program.cs @@ -0,0 +1,36 @@ +using MassTransit; +using Test.RabbitMq.Shop.Common; +using Test.RabbitMq.Shop.Common.StateMachineService; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseUrls("http://localhost:5002/"); + +builder.Services.AddMassTransit(x => +{ + x.SetKebabCaseEndpointNameFormatter(); + + x.AddSagaStateMachine() + .Endpoint(e => { e.Name = QueueNames.OrderSagaQueueName; }) + .InMemoryRepository(); + + x.UsingRabbitMq((context, cfg) => + { + cfg.Host("localhost", "/", h => + { + h.Username("guest"); + h.Password("guest"); + }); + + cfg.ReceiveEndpoint(QueueNames.OrderSagaQueueName, c => + { + c.UseMessageRetry(r => r.Interval(3, 1000)); + + c.StateMachineSaga(context); + }); + }); +}); + +var app = builder.Build(); + +app.Run(); \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common.StateMachineService/Test.RabbitMq.Shop.Common.StateMachineService.csproj b/Test.RabbitMq.Shop.Common.StateMachineService/Test.RabbitMq.Shop.Common.StateMachineService.csproj new file mode 100644 index 0000000..04b05bc --- /dev/null +++ b/Test.RabbitMq.Shop.Common.StateMachineService/Test.RabbitMq.Shop.Common.StateMachineService.csproj @@ -0,0 +1,27 @@ + + + + Exe + net6.0 + enable + enable + Linux + + + + + .dockerignore + + + + + + + + + + + + + + diff --git a/Test.RabbitMq.Shop.Common/Messages/BaseEvent.cs b/Test.RabbitMq.Shop.Common/Messages/BaseEvent.cs deleted file mode 100644 index 480f66a..0000000 --- a/Test.RabbitMq.Shop.Common/Messages/BaseEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Test.RabbitMq.Shop.Common.Messages; - -public abstract class BaseEvent -{ - protected BaseEvent(Guid correlationId) - { - CorrelationId = correlationId; - } - - public Guid Id { get; set; } = Guid.NewGuid(); - public DateTime EventCreationDate { get; set; } = DateTime.Now; - public Guid CorrelationId { get; set; } -} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common/Messages/CheckNotificationEvent.cs b/Test.RabbitMq.Shop.Common/Messages/CheckNotificationEvent.cs new file mode 100644 index 0000000..cf791ce --- /dev/null +++ b/Test.RabbitMq.Shop.Common/Messages/CheckNotificationEvent.cs @@ -0,0 +1,20 @@ +using MassTransit; + +namespace Test.RabbitMq.Shop.Common.Messages; + +public interface ICheckNotificationEvent : CorrelatedBy +{ + public Guid OrderId { get; set; } +} + +public class CheckNotificationEvent : ICheckNotificationEvent +{ + public CheckNotificationEvent(Guid correlationId, Guid orderId) + { + CorrelationId = correlationId; + OrderId = orderId; + } + + public Guid OrderId { get; set; } + public Guid CorrelationId { get; } +} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common/Messages/NotificationSentEvent.cs b/Test.RabbitMq.Shop.Common/Messages/NotificationSentEvent.cs index 7f95bca..d9084e9 100644 --- a/Test.RabbitMq.Shop.Common/Messages/NotificationSentEvent.cs +++ b/Test.RabbitMq.Shop.Common/Messages/NotificationSentEvent.cs @@ -1,11 +1,20 @@ -namespace Test.RabbitMq.Shop.Common.Messages; +using MassTransit; -public class NotificationSentEvent : BaseEvent +namespace Test.RabbitMq.Shop.Common.Messages; + +public interface INotificationSentEvent : CorrelatedBy +{ + public Guid OrderId { get; set; } +} + +public class NotificationSentEvent : INotificationSentEvent { - public NotificationSentEvent(Guid correlationId, Guid orderId) : base(correlationId) + public NotificationSentEvent(Guid correlationId, Guid orderId) { + CorrelationId = correlationId; OrderId = orderId; } public Guid OrderId { get; set; } + public Guid CorrelationId { get; } } \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common/Messages/OrderCreatedEvent.cs b/Test.RabbitMq.Shop.Common/Messages/OrderCreatedEvent.cs index 680412f..305dc1f 100644 --- a/Test.RabbitMq.Shop.Common/Messages/OrderCreatedEvent.cs +++ b/Test.RabbitMq.Shop.Common/Messages/OrderCreatedEvent.cs @@ -1,10 +1,20 @@ -namespace Test.RabbitMq.Shop.Common.Messages; +using MassTransit; -public class OrderCreatedEvent : BaseEvent +namespace Test.RabbitMq.Shop.Common.Messages; + +public interface IOrderCreatedEvent : CorrelatedBy +{ + public Guid OrderId { get; set; } + public int ProductId { get; set; } + public int ProductQuantity { get; set; } + public decimal OrderPrice { get; set; } +} + +public class OrderCreatedEvent : IOrderCreatedEvent { - public OrderCreatedEvent(Guid correlationId, Guid orderId, int productId, int productQuantity, decimal orderPrice) - : base(correlationId) + public OrderCreatedEvent(Guid orderId, int productId, int productQuantity, decimal orderPrice) { + CorrelationId = Guid.NewGuid(); OrderId = orderId; ProductId = productId; ProductQuantity = productQuantity; @@ -15,4 +25,5 @@ public OrderCreatedEvent(Guid correlationId, Guid orderId, int productId, int pr public int ProductId { get; set; } public int ProductQuantity { get; set; } public decimal OrderPrice { get; set; } + public Guid CorrelationId { get; } } \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common/Messages/SendNotificationEvent.cs b/Test.RabbitMq.Shop.Common/Messages/SendNotificationEvent.cs new file mode 100644 index 0000000..a70ab1b --- /dev/null +++ b/Test.RabbitMq.Shop.Common/Messages/SendNotificationEvent.cs @@ -0,0 +1,20 @@ +using MassTransit; + +namespace Test.RabbitMq.Shop.Common.Messages; + +public interface ISendNotificationEvent : CorrelatedBy +{ + public Guid OrderId { get; set; } +} + +public class SendNotificationEvent : ISendNotificationEvent +{ + public SendNotificationEvent(Guid correlationId, Guid orderId) + { + CorrelationId = correlationId; + OrderId = orderId; + } + + public Guid OrderId { get; set; } + public Guid CorrelationId { get; } +} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common/QueueNames.cs b/Test.RabbitMq.Shop.Common/QueueNames.cs new file mode 100644 index 0000000..f2630b0 --- /dev/null +++ b/Test.RabbitMq.Shop.Common/QueueNames.cs @@ -0,0 +1,7 @@ +namespace Test.RabbitMq.Shop.Common; + +public static class QueueNames +{ + public static string OrderSagaQueueName => "order_saga"; + public static string NotificationQueueName => "order_notification"; +} \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Common/Test.RabbitMq.Shop.Common.csproj b/Test.RabbitMq.Shop.Common/Test.RabbitMq.Shop.Common.csproj index 06201ee..502fb05 100644 --- a/Test.RabbitMq.Shop.Common/Test.RabbitMq.Shop.Common.csproj +++ b/Test.RabbitMq.Shop.Common/Test.RabbitMq.Shop.Common.csproj @@ -17,4 +17,5 @@ + diff --git a/Test.RabbitMq.Shop.Data/DataLayerExtension.cs b/Test.RabbitMq.Shop.Data/DataLayerExtension.cs index a97e184..45a110e 100644 --- a/Test.RabbitMq.Shop.Data/DataLayerExtension.cs +++ b/Test.RabbitMq.Shop.Data/DataLayerExtension.cs @@ -7,7 +7,7 @@ namespace Test.RabbitMq.Shop.Data; public static class DataLayerExtension { - public static IServiceCollection AddDataLayerDependencies(this IServiceCollection services) + public static void AddDataLayerDependencies(this IServiceCollection services) { services.AddDbContext( o => o.UseInMemoryDatabase("TestShopDb")); @@ -15,7 +15,5 @@ public static IServiceCollection AddDataLayerDependencies(this IServiceCollectio services.AddScoped(); services.AddScoped(); services.AddScoped(); - - return services; } } \ No newline at end of file diff --git a/Test.RabbitMq.Shop.Data/TestDataSeeder.cs b/Test.RabbitMq.Shop.Data/TestDataSeeder.cs index 27ee9b3..5b7753d 100644 --- a/Test.RabbitMq.Shop.Data/TestDataSeeder.cs +++ b/Test.RabbitMq.Shop.Data/TestDataSeeder.cs @@ -36,21 +36,18 @@ private void SeedProducts() _context.Products.AddRange( new Product { - // Id = new Guid("5FCAB8F3-E575-47B9-83D9-7BC62BBF6819"), Id = 1, Name = "First Test Product", Price = (decimal)99.99 }, new Product { - // Id = new Guid("8500D76C-97A4-4751-B245-7C56DFBF3431"), Id = 2, Name = "Second Test Product", Price = (decimal)235.00 }, new Product { - // Id = new Guid("F3466D83-A045-4A44-8A91-3AC8390110F0"), Id = 3, Name = "Third Test Product", Price = (decimal)128.56 diff --git a/Test.RabbitMq.Shop.sln b/Test.RabbitMq.Shop.sln index bd4a283..2e91b75 100644 --- a/Test.RabbitMq.Shop.sln +++ b/Test.RabbitMq.Shop.sln @@ -18,6 +18,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{5FFC87B8-A EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{241DD4FC-9D89-4FA9-974B-D646B2D25F27}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.RabbitMq.Shop.Common.StateMachineService", "Test.RabbitMq.Shop.Common.StateMachineService\Test.RabbitMq.Shop.Common.StateMachineService.csproj", "{3471087B-0774-4257-862D-511A980F134F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -44,6 +46,10 @@ Global {AB378C16-8904-4D02-B26F-6253872F334D}.Debug|Any CPU.Build.0 = Debug|Any CPU {AB378C16-8904-4D02-B26F-6253872F334D}.Release|Any CPU.ActiveCfg = Release|Any CPU {AB378C16-8904-4D02-B26F-6253872F334D}.Release|Any CPU.Build.0 = Release|Any CPU + {3471087B-0774-4257-862D-511A980F134F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3471087B-0774-4257-862D-511A980F134F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3471087B-0774-4257-862D-511A980F134F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3471087B-0774-4257-862D-511A980F134F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {0D31312A-51D6-432E-B2CD-3AECAE2C2BA1} = {23228A66-269C-4BDF-957E-CB04DBA45440} @@ -51,5 +57,6 @@ Global {4C457F3A-4991-4C46-BD92-BD308ABA1BDA} = {FDECBFB7-9A9D-4411-A175-B61A37CC3116} {25C905C4-FD0C-4280-B8D5-EE0CD2AC0545} = {5FFC87B8-A64E-4C6C-8EC4-7762C5C73EE0} {84E79598-F9C4-4D0D-A674-B97DB6F65FC1} = {241DD4FC-9D89-4FA9-974B-D646B2D25F27} + {3471087B-0774-4257-862D-511A980F134F} = {23228A66-269C-4BDF-957E-CB04DBA45440} EndGlobalSection EndGlobal