Skip to content

Commit

Permalink
2-after & 3-before & fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBoike committed Oct 31, 2024
1 parent fec8ef4 commit bc628f8
Show file tree
Hide file tree
Showing 22 changed files with 138 additions and 181 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Divergent.Sales.ViewModelComposition.Events;
using System.Net.Http;
using Divergent.Sales.ViewModelComposition.Events;
using ITOps.Json;
using System.Net.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceComposer.AspNetCore;

namespace Divergent.Customers.ViewModelComposition;

public class OrdersLoadedSubscriber : ICompositionEventsSubscriber
{
[HttpGet("/orders/{id}")]
[HttpGet("/orders")]
public void Subscribe(ICompositionEventsPublisher publisher)
{
publisher.Subscribe<OrdersLoaded>(async (ordersLoaded, httpRequest) =>
Expand Down
48 changes: 17 additions & 31 deletions exercises/02-publish-subscribe/after/02-publish-subscribe-after.sln
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Customers", "Divergent.Customers\Divergent.Customers.csproj", "{02EE3114-734F-42DF-994C-98480E1489FE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Customers", "Divergent.Customers\Divergent.Customers.csproj", "{02EE3114-734F-42DF-994C-98480E1489FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Finance", "Divergent.Finance\Divergent.Finance.csproj", "{3EE37732-A31A-408D-AC60-2FBF08D09B56}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Finance", "Divergent.Finance\Divergent.Finance.csproj", "{3EE37732-A31A-408D-AC60-2FBF08D09B56}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Sales", "Divergent.Sales\Divergent.Sales.csproj", "{F358BD9C-7138-45C9-AA32-B27F5066FF68}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Sales", "Divergent.Sales\Divergent.Sales.csproj", "{F358BD9C-7138-45C9-AA32-B27F5066FF68}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Website", "Website", "{120B20F8-E388-4973-8F67-8340EADED83B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Finance.Messages", "Divergent.Finance.Messages\Divergent.Finance.Messages.csproj", "{01CCC8E0-605E-417D-BF33-30881F65A49B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Finance.Messages", "Divergent.Finance.Messages\Divergent.Finance.Messages.csproj", "{01CCC8E0-605E-417D-BF33-30881F65A49B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Sales.Messages", "Divergent.Sales.Messages\Divergent.Sales.Messages.csproj", "{FD850B7B-46A5-43EC-9571-C13736E6B033}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Sales.Messages", "Divergent.Sales.Messages\Divergent.Sales.Messages.csproj", "{FD850B7B-46A5-43EC-9571-C13736E6B033}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Customers.Data", "Divergent.Customers.Data\Divergent.Customers.Data.csproj", "{314AA28E-E5A9-40B3-AA9B-C2C0E5BAD059}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Customers.Data", "Divergent.Customers.Data\Divergent.Customers.Data.csproj", "{314AA28E-E5A9-40B3-AA9B-C2C0E5BAD059}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Finance.Data", "Divergent.Finance.Data\Divergent.Finance.Data.csproj", "{FEE53DC5-B52D-49DB-8F07-A8C835998283}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Finance.Data", "Divergent.Finance.Data\Divergent.Finance.Data.csproj", "{FEE53DC5-B52D-49DB-8F07-A8C835998283}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Sales.Data", "Divergent.Sales.Data\Divergent.Sales.Data.csproj", "{80F82F7D-3F0A-4316-87CD-49F19DBD5B85}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Sales.Data", "Divergent.Sales.Data\Divergent.Sales.Data.csproj", "{80F82F7D-3F0A-4316-87CD-49F19DBD5B85}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ExternalSystems", "ExternalSystems", "{41918E2F-FCC6-48D8-8A3C-3EF756BE385C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaymentProviders", "externalsystems\MastercardPaymentProvider\PaymentProviders.csproj", "{4EEFC008-F185-480A-8312-D3E9C81C5D95}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PaymentProviders", "externalsystems\MastercardPaymentProvider\PaymentProviders.csproj", "{4EEFC008-F185-480A-8312-D3E9C81C5D95}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Shipping", "Divergent.Shipping\Divergent.Shipping.csproj", "{E8BCB506-5BD6-4963-B4D0-717A26916E46}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Shipping", "Divergent.Shipping\Divergent.Shipping.csproj", "{E8BCB506-5BD6-4963-B4D0-717A26916E46}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Customers", "Customers", "{808B901F-6EF7-49F0-B668-F54EEDB1F3F1}"
EndProject
Expand All @@ -37,22 +37,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shipping", "Shipping", "{BA
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ITOps", "ITOps", "{A9587680-24D6-475A-81E8-8699773B5ED9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Customers.API", "Divergent.Customers.API\Divergent.Customers.API.csproj", "{222B8A52-4F51-4140-80B4-8AF531E293E4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Customers.API", "Divergent.Customers.API\Divergent.Customers.API.csproj", "{222B8A52-4F51-4140-80B4-8AF531E293E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Finance.API", "Divergent.Finance.API\Divergent.Finance.API.csproj", "{BF4B517B-DBC4-4107-886F-9E246312E9AF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Finance.API", "Divergent.Finance.API\Divergent.Finance.API.csproj", "{BF4B517B-DBC4-4107-886F-9E246312E9AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Sales.API", "Divergent.Sales.API\Divergent.Sales.API.csproj", "{C2FE4732-EA4E-49CC-BE34-46341FB32E09}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Sales.API", "Divergent.Sales.API\Divergent.Sales.API.csproj", "{C2FE4732-EA4E-49CC-BE34-46341FB32E09}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Shipping.Data", "Divergent.Shipping.Data\Divergent.Shipping.Data.csproj", "{C825BBFF-297D-4E68-ABB9-276FD81D4AD4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Shipping.Data", "Divergent.Shipping.Data\Divergent.Shipping.Data.csproj", "{C825BBFF-297D-4E68-ABB9-276FD81D4AD4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Frontend", "Divergent.Frontend\Divergent.Frontend.csproj", "{0EE90477-6D50-49A3-A557-3741F568E2ED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.ViewModelComposition", "..\..\shared-api-gateway\ITOps.ViewModelComposition\ITOps.ViewModelComposition.csproj", "{888DB2A9-39D2-4B21-8620-8C2BD67AAF6F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Frontend", "Divergent.Frontend\Divergent.Frontend.csproj", "{0EE90477-6D50-49A3-A557-3741F568E2ED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.Json", "..\..\shared-api-gateway\ITOps.Json\ITOps.Json.csproj", "{416C923B-61E5-4182-909C-21651394C05F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.ViewModelComposition.Gateway", "..\..\shared-api-gateway\ITOps.ViewModelComposition.Gateway\ITOps.ViewModelComposition.Gateway.csproj", "{A99F2A92-EE56-49FB-970C-5EA7935D1316}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.CompositionGateway", "Divergent.CompositionGateway\Divergent.CompositionGateway.csproj", "{4776CCE0-98E9-4E3A-9DDC-93278D63721E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Sales.ViewModelComposition", "Divergent.Sales.ViewModelComposition\Divergent.Sales.ViewModelComposition.csproj", "{A476ADD9-1DA4-46E1-8555-6040C52B76D0}"
Expand Down Expand Up @@ -131,18 +127,10 @@ Global
{0EE90477-6D50-49A3-A557-3741F568E2ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EE90477-6D50-49A3-A557-3741F568E2ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EE90477-6D50-49A3-A557-3741F568E2ED}.Release|Any CPU.Build.0 = Release|Any CPU
{888DB2A9-39D2-4B21-8620-8C2BD67AAF6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{888DB2A9-39D2-4B21-8620-8C2BD67AAF6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{888DB2A9-39D2-4B21-8620-8C2BD67AAF6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{888DB2A9-39D2-4B21-8620-8C2BD67AAF6F}.Release|Any CPU.Build.0 = Release|Any CPU
{416C923B-61E5-4182-909C-21651394C05F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{416C923B-61E5-4182-909C-21651394C05F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{416C923B-61E5-4182-909C-21651394C05F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{416C923B-61E5-4182-909C-21651394C05F}.Release|Any CPU.Build.0 = Release|Any CPU
{A99F2A92-EE56-49FB-970C-5EA7935D1316}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A99F2A92-EE56-49FB-970C-5EA7935D1316}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A99F2A92-EE56-49FB-970C-5EA7935D1316}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A99F2A92-EE56-49FB-970C-5EA7935D1316}.Release|Any CPU.Build.0 = Release|Any CPU
{4776CCE0-98E9-4E3A-9DDC-93278D63721E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4776CCE0-98E9-4E3A-9DDC-93278D63721E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4776CCE0-98E9-4E3A-9DDC-93278D63721E}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -187,9 +175,7 @@ Global
{C2FE4732-EA4E-49CC-BE34-46341FB32E09} = {3F113598-B240-4E06-B41A-6C684C208F2A}
{C825BBFF-297D-4E68-ABB9-276FD81D4AD4} = {BAFA6668-162F-4D48-8BAD-46A39C59B6FE}
{0EE90477-6D50-49A3-A557-3741F568E2ED} = {120B20F8-E388-4973-8F67-8340EADED83B}
{888DB2A9-39D2-4B21-8620-8C2BD67AAF6F} = {A9587680-24D6-475A-81E8-8699773B5ED9}
{416C923B-61E5-4182-909C-21651394C05F} = {A9587680-24D6-475A-81E8-8699773B5ED9}
{A99F2A92-EE56-49FB-970C-5EA7935D1316} = {A9587680-24D6-475A-81E8-8699773B5ED9}
{4776CCE0-98E9-4E3A-9DDC-93278D63721E} = {120B20F8-E388-4973-8F67-8340EADED83B}
{A476ADD9-1DA4-46E1-8555-6040C52B76D0} = {3F113598-B240-4E06-B41A-6C684C208F2A}
{D4B3216E-6072-4B7A-97C5-A6FC4C2ABB05} = {3F113598-B240-4E06-B41A-6C684C208F2A}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\shared-api-gateway\ITOps.ViewModelComposition.Gateway\ITOps.ViewModelComposition.Gateway.csproj" />
<ProjectReference Include="..\Divergent.Customers.ViewModelComposition\Divergent.Customers.ViewModelComposition.csproj" />
<ProjectReference Include="..\Divergent.Finance.ViewModelComposition\Divergent.Finance.ViewModelComposition.csproj" />
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition.Events\Divergent.Sales.ViewModelComposition.Events.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ITOps.ViewModelComposition;
using ITOps.ViewModelComposition.Gateway;
using ServiceComposer.AspNetCore;

namespace Divergent.CompositionGateway;

Expand All @@ -21,6 +20,10 @@ public void Configure(IApplicationBuilder app)
policyBuilder.AllowAnyHeader();
});

app.RunCompositionGatewayWithDefaultRoutes();
app.UseRouting();
app.UseEndpoints(builder =>
{
builder.MapCompositionHandlers();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceComposer.AspNetCore" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\shared-api-gateway\ITOps.Json\ITOps.Json.csproj" />
<ProjectReference Include="..\..\..\shared-api-gateway\ITOps.ViewModelComposition\ITOps.ViewModelComposition.csproj" />
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition.Events\Divergent.Sales.ViewModelComposition.Events.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
using Divergent.Sales.ViewModelComposition.Events;
using System.Net.Http;
using Divergent.Sales.ViewModelComposition.Events;
using ITOps.Json;
using ITOps.ViewModelComposition;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using System;
using System.Net.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceComposer.AspNetCore;

namespace Divergent.Customers.ViewModelComposition;

public class OrdersLoadedSubscriber : ISubscribeToCompositionEvents
public class OrdersLoadedSubscriber : ICompositionEventsSubscriber
{
// Very simple matching for the purpose of the exercise.
public bool Matches(RouteData routeData, string httpMethod) =>
HttpMethods.IsGet(httpMethod)
&& string.Equals((string)routeData.Values["controller"], "orders", StringComparison.OrdinalIgnoreCase)
&& !routeData.Values.ContainsKey("id");

public void Subscribe(IPublishCompositionEvents publisher)
[HttpGet("/orders")]
public void Subscribe(ICompositionEventsPublisher publisher)
{
publisher.Subscribe<OrdersLoaded>(async (pageViewModel, ordersLoaded, routeData, query) =>
publisher.Subscribe<OrdersLoaded>(async (ordersLoaded, httpRequest) =>
{
var orderIds = string.Join(",", ordersLoaded.OrderViewModelDictionary.Keys);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceComposer.AspNetCore" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\shared-api-gateway\ITOps.Json\ITOps.Json.csproj" />
<ProjectReference Include="..\..\..\shared-api-gateway\ITOps.ViewModelComposition\ITOps.ViewModelComposition.csproj" />
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition.Events\Divergent.Sales.ViewModelComposition.Events.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
using Divergent.Sales.ViewModelComposition.Events;
using System.Net.Http;
using Divergent.Sales.ViewModelComposition.Events;
using ITOps.Json;
using ITOps.ViewModelComposition;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using System;
using System.Net.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceComposer.AspNetCore;

namespace Divergent.Finance.ViewModelComposition;

public class OrdersLoadedSubscriber : ISubscribeToCompositionEvents
public class OrdersLoadedSubscriber : ICompositionEventsSubscriber
{
// Very simple matching for the purpose of the exercise.
public bool Matches(RouteData routeData, string httpMethod) =>
HttpMethods.IsGet(httpMethod)
&& string.Equals((string)routeData.Values["controller"], "orders", StringComparison.OrdinalIgnoreCase)
&& !routeData.Values.ContainsKey("id");

public void Subscribe(IPublishCompositionEvents publisher)
[HttpGet("/orders")]
public void Subscribe(ICompositionEventsPublisher publisher)
{
publisher.Subscribe<OrdersLoaded>(async (pageViewModel, ordersLoaded, routeData, query) =>
publisher.Subscribe<OrdersLoaded>(async (ordersLoaded, httpRequest) =>
{
var orderIds = string.Join(",", ordersLoaded.OrderViewModelDictionary.Keys);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Divergent.Sales.Messages.Events;
using NServiceBus;
using Divergent.Finance.Data.Models;
using Divergent.Finance.Data.Models;
using Divergent.Finance.Messages.Commands;
using Divergent.Sales.Messages.Events;
using ITOps.EndpointConfig;
using NServiceBus;

namespace Divergent.Finance.Handlers;

Expand All @@ -25,10 +25,10 @@ public async Task Handle(OrderSubmittedEvent message, IMessageHandlerContext con

var prices = db.Database.GetCollection<Price>();
var orderItemPrices = db.Database.GetCollection<OrderItemPrice>();

var query = from price in prices.Query()
where message.Products.Contains(price.ProductId)
select price;
where message.Products.Contains(price.ProductId)
select price;

foreach (var price in query.ToList())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceComposer.AspNetCore" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition.Events\Divergent.Sales.ViewModelComposition.Events.csproj" />
<ProjectReference Include="..\..\..\shared-api-gateway\ITOps.Json\ITOps.Json.csproj" />
<ProjectReference Include="..\..\..\shared-api-gateway\ITOps.ViewModelComposition\ITOps.ViewModelComposition.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
using Divergent.Sales.ViewModelComposition.Events;
using ITOps.Json;
using ITOps.ViewModelComposition;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Dynamic;
using System.Net.Http;
using System.Threading.Tasks;
using Divergent.Sales.ViewModelComposition.Events;
using ITOps.Json;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceComposer.AspNetCore;

namespace Divergent.Sales.ViewModelComposition;

public class OrdersListViewModelAppender : IViewModelAppender
public class OrdersListViewModelAppender : ICompositionRequestsHandler
{
public bool Matches(RouteData routeData, string httpMethod) =>
HttpMethods.IsGet(httpMethod)
&& string.Equals((string)routeData.Values["controller"], "orders", StringComparison.OrdinalIgnoreCase)
&& !routeData.Values.ContainsKey("id");

public async Task Append(dynamic viewModel, RouteData routeData, IQueryCollection query)
[HttpGet("/orders")]
public async Task Handle(HttpRequest request)
{
// Hardcoded for simplicity. In a production app, a config object could be injected.
var url = $"http://localhost:20185/api/orders";
Expand All @@ -28,8 +23,10 @@ public async Task Append(dynamic viewModel, RouteData routeData, IQueryCollectio

var orderViewModelDictionary = MapToViewModelDictionary(orders);

await viewModel.RaiseEventAsync(new OrdersLoaded { OrderViewModelDictionary = orderViewModelDictionary });
var compositionContext = request.GetCompositionContext();
await compositionContext.RaiseEvent(new OrdersLoaded { OrderViewModelDictionary = orderViewModelDictionary });

var viewModel = request.GetComposedResponseModel();
viewModel.Orders = orderViewModelDictionary.Values;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Net.Http.Headers;
using System.Net.NetworkInformation;
using Divergent.Sales.Data.Models;
using Divergent.Sales.Data.Models;
using Divergent.Sales.Messages.Commands;
using Divergent.Sales.Messages.Events;
using ITOps.EndpointConfig;
using LiteDB;
using NServiceBus;

namespace Divergent.Sales.Handlers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Divergent.Customers.ViewModelComposition;

public class OrdersLoadedSubscriber : ICompositionEventsSubscriber
{
[HttpGet("/orders/{id}")]
[HttpGet("/orders")]
public void Subscribe(ICompositionEventsPublisher publisher)
{
publisher.Subscribe<OrdersLoaded>(async (ordersLoaded, httpRequest) =>
Expand Down
Loading

0 comments on commit bc628f8

Please sign in to comment.