From ae1ba4c7850baef263a83ac4832f55353a310bb1 Mon Sep 17 00:00:00 2001 From: David Guida Date: Mon, 29 Aug 2022 20:52:19 -0400 Subject: [PATCH] updated sample 3 to use nuget packages instead of project references --- .../OpenSleigh.Samples.Sample3.API.csproj | 19 +++++----- .../OpenSleigh.Samples.Sample3.Common.csproj | 6 ++-- .../OpenSleigh.Samples.Sample3.Worker.csproj | 11 +++--- .../Program.cs | 6 +++- .../Sagas/ParentSaga.cs | 1 - .../Sagas/SimpleSaga.cs | 3 +- samples/Sample3/Sample3.sln | 36 ++----------------- 7 files changed, 27 insertions(+), 55 deletions(-) diff --git a/samples/Sample3/OpenSleigh.Samples.Sample3.API/OpenSleigh.Samples.Sample3.API.csproj b/samples/Sample3/OpenSleigh.Samples.Sample3.API/OpenSleigh.Samples.Sample3.API.csproj index 5f1b2554..0ae58259 100644 --- a/samples/Sample3/OpenSleigh.Samples.Sample3.API/OpenSleigh.Samples.Sample3.API.csproj +++ b/samples/Sample3/OpenSleigh.Samples.Sample3.API/OpenSleigh.Samples.Sample3.API.csproj @@ -5,16 +5,17 @@ - - - - + + + - - - - - + + + + + + + diff --git a/samples/Sample3/OpenSleigh.Samples.Sample3.Common/OpenSleigh.Samples.Sample3.Common.csproj b/samples/Sample3/OpenSleigh.Samples.Sample3.Common/OpenSleigh.Samples.Sample3.Common.csproj index 0ffdf2e9..81cb219e 100644 --- a/samples/Sample3/OpenSleigh.Samples.Sample3.Common/OpenSleigh.Samples.Sample3.Common.csproj +++ b/samples/Sample3/OpenSleigh.Samples.Sample3.Common/OpenSleigh.Samples.Sample3.Common.csproj @@ -4,8 +4,8 @@ net6.0 - - - + + + diff --git a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/OpenSleigh.Samples.Sample3.Worker.csproj b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/OpenSleigh.Samples.Sample3.Worker.csproj index 426aae6a..2872114f 100644 --- a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/OpenSleigh.Samples.Sample3.Worker.csproj +++ b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/OpenSleigh.Samples.Sample3.Worker.csproj @@ -7,16 +7,15 @@ - - + - + + + + - - - diff --git a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Program.cs b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Program.cs index cafd8a0d..49e6b84a 100644 --- a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Program.cs +++ b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Program.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -9,6 +10,7 @@ using OpenSleigh.Samples.Sample3.Common.Messages; using OpenSleigh.Samples.Sample3.Worker.Sagas; using OpenSleigh.Transport.RabbitMQ; +using OpenSleigh.Core; namespace OpenSleigh.Samples.Sample3.Worker { @@ -52,6 +54,8 @@ static IHostBuilder CreateHostBuilder(string[] args) => new QueueReferences("child", "child.process", "child.process", "child.dead", "child.dead.process")); }) .UseSqlServerPersistence(sqlConfig); + + Core.SagaState state = new SimpleSagaState(Guid.NewGuid()); cfg.AddSaga() .UseStateFactory(msg => new SimpleSagaState(msg.CorrelationId)) diff --git a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/ParentSaga.cs b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/ParentSaga.cs index 4c66d6c1..c2e0824c 100644 --- a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/ParentSaga.cs +++ b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/ParentSaga.cs @@ -5,7 +5,6 @@ using OpenSleigh.Core; using OpenSleigh.Core.Messaging; using OpenSleigh.Samples.Sample3.Common.Messages; -using OpenSleigh.Samples.Sample3.Worker.Sagas; namespace OpenSleigh.Samples.Sample3.Worker.Sagas { diff --git a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/SimpleSaga.cs b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/SimpleSaga.cs index 3b0aaa43..38be3d2e 100644 --- a/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/SimpleSaga.cs +++ b/samples/Sample3/OpenSleigh.Samples.Sample3.Worker/Sagas/SimpleSaga.cs @@ -8,7 +8,8 @@ namespace OpenSleigh.Samples.Sample3.Worker.Sagas { - public record SimpleSagaState : SagaState{ + public record SimpleSagaState : SagaState + { public SimpleSagaState(Guid id) : base(id){} } diff --git a/samples/Sample3/Sample3.sln b/samples/Sample3/Sample3.sln index 647eabe2..3ca959d1 100644 --- a/samples/Sample3/Sample3.sln +++ b/samples/Sample3/Sample3.sln @@ -1,24 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30804.86 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32802.462 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSleigh.Samples.Sample3.API", "OpenSleigh.Samples.Sample3.API\OpenSleigh.Samples.Sample3.API.csproj", "{A94C718C-3B49-4E67-BACB-4B6615C97839}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "library", "library", "{179EFC5F-B0C8-4649-BF7C-24E9EBDFBBA8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSleigh.Core", "..\..\src\OpenSleigh.Core\OpenSleigh.Core.csproj", "{CE375B34-1590-4544-9B33-70EF4C25D54C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSleigh.Transport.RabbitMQ", "..\..\src\OpenSleigh.Transport.RabbitMQ\OpenSleigh.Transport.RabbitMQ.csproj", "{31E2559D-4E5C-4110-AA42-99F46DDCE7B3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSleigh.Samples.Sample3.Worker", "OpenSleigh.Samples.Sample3.Worker\OpenSleigh.Samples.Sample3.Worker.csproj", "{3CCAD730-A162-42BC-BF64-307A964010DF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSleigh.Samples.Sample3.Common", "OpenSleigh.Samples.Sample3.Common\OpenSleigh.Samples.Sample3.Common.csproj", "{42152DFE-AA8D-480A-BD57-B2D31A0DEC32}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSleigh.Persistence.SQL", "..\..\src\OpenSleigh.Persistence.SQL\OpenSleigh.Persistence.SQL.csproj", "{5242977B-11A8-48F3-BE45-63892666C81E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSleigh.Persistence.SQLServer", "..\..\src\OpenSleigh.Persistence.SQLServer\OpenSleigh.Persistence.SQLServer.csproj", "{924DA7FF-5A89-4840-80AA-EBA266B3FD5B}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,14 +19,6 @@ Global {A94C718C-3B49-4E67-BACB-4B6615C97839}.Debug|Any CPU.Build.0 = Debug|Any CPU {A94C718C-3B49-4E67-BACB-4B6615C97839}.Release|Any CPU.ActiveCfg = Release|Any CPU {A94C718C-3B49-4E67-BACB-4B6615C97839}.Release|Any CPU.Build.0 = Release|Any CPU - {CE375B34-1590-4544-9B33-70EF4C25D54C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE375B34-1590-4544-9B33-70EF4C25D54C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE375B34-1590-4544-9B33-70EF4C25D54C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE375B34-1590-4544-9B33-70EF4C25D54C}.Release|Any CPU.Build.0 = Release|Any CPU - {31E2559D-4E5C-4110-AA42-99F46DDCE7B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {31E2559D-4E5C-4110-AA42-99F46DDCE7B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {31E2559D-4E5C-4110-AA42-99F46DDCE7B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {31E2559D-4E5C-4110-AA42-99F46DDCE7B3}.Release|Any CPU.Build.0 = Release|Any CPU {3CCAD730-A162-42BC-BF64-307A964010DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3CCAD730-A162-42BC-BF64-307A964010DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {3CCAD730-A162-42BC-BF64-307A964010DF}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -45,24 +27,10 @@ Global {42152DFE-AA8D-480A-BD57-B2D31A0DEC32}.Debug|Any CPU.Build.0 = Debug|Any CPU {42152DFE-AA8D-480A-BD57-B2D31A0DEC32}.Release|Any CPU.ActiveCfg = Release|Any CPU {42152DFE-AA8D-480A-BD57-B2D31A0DEC32}.Release|Any CPU.Build.0 = Release|Any CPU - {5242977B-11A8-48F3-BE45-63892666C81E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5242977B-11A8-48F3-BE45-63892666C81E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5242977B-11A8-48F3-BE45-63892666C81E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5242977B-11A8-48F3-BE45-63892666C81E}.Release|Any CPU.Build.0 = Release|Any CPU - {924DA7FF-5A89-4840-80AA-EBA266B3FD5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {924DA7FF-5A89-4840-80AA-EBA266B3FD5B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {924DA7FF-5A89-4840-80AA-EBA266B3FD5B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {924DA7FF-5A89-4840-80AA-EBA266B3FD5B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {CE375B34-1590-4544-9B33-70EF4C25D54C} = {179EFC5F-B0C8-4649-BF7C-24E9EBDFBBA8} - {31E2559D-4E5C-4110-AA42-99F46DDCE7B3} = {179EFC5F-B0C8-4649-BF7C-24E9EBDFBBA8} - {5242977B-11A8-48F3-BE45-63892666C81E} = {179EFC5F-B0C8-4649-BF7C-24E9EBDFBBA8} - {924DA7FF-5A89-4840-80AA-EBA266B3FD5B} = {179EFC5F-B0C8-4649-BF7C-24E9EBDFBBA8} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BC78DE5A-D1CC-46D6-ADDA-3A8F41324E03} EndGlobalSection