Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ServiceComposer for demos #349

Merged
merged 24 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c21c33f
Remove custom composition code
mauroservienti Jan 9, 2023
1a7b496
Use .NET 7
mauroservienti Jan 9, 2023
fd57c7a
Add LiteDb required infrastructure
mauroservienti Jan 9, 2023
7ea95ad
Convert CompositionGateway to use ServiceComposer
mauroservienti Jan 9, 2023
6eade7d
Convert Sales composition API to use ServiceComposer
mauroservienti Jan 9, 2023
593b674
Convert Shipping composition API to use ServiceComposer
mauroservienti Jan 9, 2023
8633c3d
Convert shipping data to LiteDb
mauroservienti Jan 9, 2023
edaf7ad
Convert Shipping API to ASP.Net Core web API
mauroservienti Jan 9, 2023
f63ea79
Build the demos
mauroservienti Jan 9, 2023
8407ab1
Rename the Sales API project
mauroservienti Jan 9, 2023
8c046a5
Fix routing
mauroservienti Jan 9, 2023
7dde5c6
Update dependencies and fix namespaces
mauroservienti Jan 9, 2023
2adcb06
Use LiteDb for data
mauroservienti Jan 9, 2023
519c09f
Use the expected port
mauroservienti Jan 9, 2023
a74699c
Convert Sales API to ASP.Net Core web API
mauroservienti Jan 9, 2023
ce984e8
Add renamed and new projects
mauroservienti Jan 9, 2023
546acc2
Use .NET 7 for web app
mauroservienti Jan 9, 2023
68bc2f4
Convert to ASP.Net Core web application
mauroservienti Jan 9, 2023
91c1e50
Fix route
mauroservienti Jan 9, 2023
c1c2333
match web app route
mauroservienti Jan 9, 2023
85eda6b
adjust to serialization format
mauroservienti Jan 9, 2023
fce6ef8
Comment about why pagination is kept even if not used
mauroservienti Jan 9, 2023
0607ee8
Update README and list demo requests
mauroservienti Jan 9, 2023
6c20186
Merge branch 'master' into use-service-composer-for-demos
mauroservienti Jan 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Build composition gateway demo
run: dotnet build demos/asp-net-core/Divergent.CompositionGateway.sln --configuration Release
- name: Build composition wedsite demo
run: dotnet build demos/asp-net-core/Divergent.Website.sln --configuration Release
- name: Build exercise 01 - before
run: dotnet build exercises/01-composite-ui/before --configuration Release
- name: Build exercise 01 - after
Expand Down
55 changes: 24 additions & 31 deletions demos/asp-net-core/Divergent.CompositionGateway.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.CompositionGateway", "Divergent.CompositionGateway\Divergent.CompositionGateway.csproj", "{C0E4CD4F-657A-4872-969C-D97768636BDA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ITOps", "ITOps", "{DB3EFAF6-6B45-48ED-BCB9-5F44FAB30CF9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.ViewModelComposition.Gateway", "ITOps.ViewModelComposition.Gateway\ITOps.ViewModelComposition.Gateway.csproj", "{1B2BC5FF-3F95-4429-8AE1-5AC6C99B689A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.ViewModelComposition", "ITOps.ViewModelComposition\ITOps.ViewModelComposition.csproj", "{10268718-D7A5-4F3B-A91C-A991DD93FAF6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sales", "Sales", "{C243015C-AEC9-4694-889E-4B57E208FD2A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Sales.ViewModelComposition", "Divergent.Sales.ViewModelComposition\Divergent.Sales.ViewModelComposition.csproj", "{7F90C43D-41F7-4243-823C-A05034FEADE2}"
Expand All @@ -21,15 +17,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shipping", "Shipping", "{9D
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Shipping.ViewModelComposition", "Divergent.Shipping.ViewModelComposition\Divergent.Shipping.ViewModelComposition.csproj", "{657A5136-DDDE-493F-9247-B2789B3294F3}"
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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Sales.API.Host", "Divergent.Sales.API.Host\Divergent.Sales.API.Host.csproj", "{DC8ADA37-837C-490F-BDFC-FC8D1001417E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Shipping.Data", "Divergent.Shipping.Data\Divergent.Shipping.Data.csproj", "{0EFF2E29-829B-4B1C-A7C6-47D63B05F52B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Shipping.Data", "Divergent.Shipping.Data\Divergent.Shipping.Data.csproj", "{0EFF2E29-829B-4B1C-A7C6-47D63B05F52B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.Json", "ITOps.Json\ITOps.Json.csproj", "{4951C5A4-59D4-4AE1-B74C-B6F667544211}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divergent.Shipping.API.Host", "Divergent.Shipping.API.Host\Divergent.Shipping.API.Host.csproj", "{0059E3AC-0AFA-43F6-B631-200CBB723F94}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.Data", "ITOps.Data\ITOps.Data.csproj", "{B6CB4898-0B49-4B8E-AB22-0893332D2F3D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ITOps.Json", "ITOps.Json\ITOps.Json.csproj", "{4951C5A4-59D4-4AE1-B74C-B6F667544211}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Shipping.API", "Divergent.Shipping.API\Divergent.Shipping.API.csproj", "{487F6A19-E82A-44B2-96D4-3098B7AFF4BD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Divergent.Sales.API", "Divergent.Sales.API\Divergent.Sales.API.csproj", "{75FB7221-8808-422C-996A-10472403711B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -41,14 +39,6 @@ Global
{C0E4CD4F-657A-4872-969C-D97768636BDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0E4CD4F-657A-4872-969C-D97768636BDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0E4CD4F-657A-4872-969C-D97768636BDA}.Release|Any CPU.Build.0 = Release|Any CPU
{1B2BC5FF-3F95-4429-8AE1-5AC6C99B689A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B2BC5FF-3F95-4429-8AE1-5AC6C99B689A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B2BC5FF-3F95-4429-8AE1-5AC6C99B689A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B2BC5FF-3F95-4429-8AE1-5AC6C99B689A}.Release|Any CPU.Build.0 = Release|Any CPU
{10268718-D7A5-4F3B-A91C-A991DD93FAF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10268718-D7A5-4F3B-A91C-A991DD93FAF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10268718-D7A5-4F3B-A91C-A991DD93FAF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10268718-D7A5-4F3B-A91C-A991DD93FAF6}.Release|Any CPU.Build.0 = Release|Any CPU
{7F90C43D-41F7-4243-823C-A05034FEADE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F90C43D-41F7-4243-823C-A05034FEADE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F90C43D-41F7-4243-823C-A05034FEADE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -65,37 +55,40 @@ Global
{80F82F7D-3F0A-4316-87CD-49F19DBD5B85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80F82F7D-3F0A-4316-87CD-49F19DBD5B85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80F82F7D-3F0A-4316-87CD-49F19DBD5B85}.Release|Any CPU.Build.0 = Release|Any CPU
{DC8ADA37-837C-490F-BDFC-FC8D1001417E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC8ADA37-837C-490F-BDFC-FC8D1001417E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC8ADA37-837C-490F-BDFC-FC8D1001417E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC8ADA37-837C-490F-BDFC-FC8D1001417E}.Release|Any CPU.Build.0 = Release|Any CPU
{0EFF2E29-829B-4B1C-A7C6-47D63B05F52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EFF2E29-829B-4B1C-A7C6-47D63B05F52B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EFF2E29-829B-4B1C-A7C6-47D63B05F52B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EFF2E29-829B-4B1C-A7C6-47D63B05F52B}.Release|Any CPU.Build.0 = Release|Any CPU
{0059E3AC-0AFA-43F6-B631-200CBB723F94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0059E3AC-0AFA-43F6-B631-200CBB723F94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0059E3AC-0AFA-43F6-B631-200CBB723F94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0059E3AC-0AFA-43F6-B631-200CBB723F94}.Release|Any CPU.Build.0 = Release|Any CPU
{4951C5A4-59D4-4AE1-B74C-B6F667544211}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4951C5A4-59D4-4AE1-B74C-B6F667544211}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4951C5A4-59D4-4AE1-B74C-B6F667544211}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4951C5A4-59D4-4AE1-B74C-B6F667544211}.Release|Any CPU.Build.0 = Release|Any CPU
{B6CB4898-0B49-4B8E-AB22-0893332D2F3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6CB4898-0B49-4B8E-AB22-0893332D2F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6CB4898-0B49-4B8E-AB22-0893332D2F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6CB4898-0B49-4B8E-AB22-0893332D2F3D}.Release|Any CPU.Build.0 = Release|Any CPU
{487F6A19-E82A-44B2-96D4-3098B7AFF4BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{487F6A19-E82A-44B2-96D4-3098B7AFF4BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{487F6A19-E82A-44B2-96D4-3098B7AFF4BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{487F6A19-E82A-44B2-96D4-3098B7AFF4BD}.Release|Any CPU.Build.0 = Release|Any CPU
{75FB7221-8808-422C-996A-10472403711B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75FB7221-8808-422C-996A-10472403711B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75FB7221-8808-422C-996A-10472403711B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75FB7221-8808-422C-996A-10472403711B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1B2BC5FF-3F95-4429-8AE1-5AC6C99B689A} = {DB3EFAF6-6B45-48ED-BCB9-5F44FAB30CF9}
{10268718-D7A5-4F3B-A91C-A991DD93FAF6} = {DB3EFAF6-6B45-48ED-BCB9-5F44FAB30CF9}
{7F90C43D-41F7-4243-823C-A05034FEADE2} = {C243015C-AEC9-4694-889E-4B57E208FD2A}
{5875B01D-5A47-4B08-99B2-48D217F09B30} = {C243015C-AEC9-4694-889E-4B57E208FD2A}
{657A5136-DDDE-493F-9247-B2789B3294F3} = {9D36D6A4-373C-4CB0-8B54-D15505E2AE91}
{80F82F7D-3F0A-4316-87CD-49F19DBD5B85} = {C243015C-AEC9-4694-889E-4B57E208FD2A}
{DC8ADA37-837C-490F-BDFC-FC8D1001417E} = {C243015C-AEC9-4694-889E-4B57E208FD2A}
{0EFF2E29-829B-4B1C-A7C6-47D63B05F52B} = {9D36D6A4-373C-4CB0-8B54-D15505E2AE91}
{0059E3AC-0AFA-43F6-B631-200CBB723F94} = {9D36D6A4-373C-4CB0-8B54-D15505E2AE91}
{4951C5A4-59D4-4AE1-B74C-B6F667544211} = {DB3EFAF6-6B45-48ED-BCB9-5F44FAB30CF9}
{B6CB4898-0B49-4B8E-AB22-0893332D2F3D} = {DB3EFAF6-6B45-48ED-BCB9-5F44FAB30CF9}
{487F6A19-E82A-44B2-96D4-3098B7AFF4BD} = {9D36D6A4-373C-4CB0-8B54-D15505E2AE91}
{75FB7221-8808-422C-996A-10472403711B} = {C243015C-AEC9-4694-889E-4B57E208FD2A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {165CC020-BD77-48FE-B305-073441440289}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition.Events\Divergent.Sales.ViewModelComposition.Events.csproj" />
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition\Divergent.Sales.ViewModelComposition.csproj" />
<ProjectReference Include="..\Divergent.Shipping.ViewModelComposition\Divergent.Shipping.ViewModelComposition.csproj" />
<ProjectReference Include="..\ITOps.ViewModelComposition.Gateway\ITOps.ViewModelComposition.Gateway.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ServiceComposer.AspNetCore" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition.Events\Divergent.Sales.ViewModelComposition.Events.csproj" />
<ProjectReference Include="..\Divergent.Sales.ViewModelComposition\Divergent.Sales.ViewModelComposition.csproj" />
<ProjectReference Include="..\Divergent.Shipping.ViewModelComposition\Divergent.Shipping.ViewModelComposition.csproj" />
</ItemGroup>

</Project>
15 changes: 7 additions & 8 deletions demos/asp-net-core/Divergent.CompositionGateway/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using System;
using System.IO;

namespace Divergent.CompositionGateway
Expand All @@ -7,14 +9,11 @@ public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

host.Run();
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"profiles": {
"Divergent.CompositionGateway": {
"commandName": "Project",
"launchBrowser": false,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
Expand Down
9 changes: 5 additions & 4 deletions demos/asp-net-core/Divergent.CompositionGateway/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
using ITOps.ViewModelComposition;
using ITOps.ViewModelComposition.Gateway;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using ServiceComposer.AspNetCore;

namespace Divergent.CompositionGateway
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient();
services.AddRouting();
services.AddViewModelComposition();
}

public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
app.RunCompositionGatewayWithDefaultRoutes();
app.UseRouting();
app.UseEndpoints(builder => builder.MapCompositionHandlers());
}
}
}
29 changes: 0 additions & 29 deletions demos/asp-net-core/Divergent.Sales.API.Host/App.config

This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions demos/asp-net-core/Divergent.Sales.API.Host/Program.cs

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions demos/asp-net-core/Divergent.Sales.API.Host/SalesAPI.cs

This file was deleted.

Loading