From e00c40385130ff3bac30ccc59554ad9b2b37011b Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Date: Thu, 3 Oct 2024 16:05:42 -0500 Subject: [PATCH 1/6] Shouldn't display an error if assembly cannot be registered. --- .../modulith/Shared/Modulith.UI/ServiceCollectionExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/working/content/modulith/Shared/Modulith.UI/ServiceCollectionExtensions.cs b/working/content/modulith/Shared/Modulith.UI/ServiceCollectionExtensions.cs index 7fd8e74..7c2382b 100644 --- a/working/content/modulith/Shared/Modulith.UI/ServiceCollectionExtensions.cs +++ b/working/content/modulith/Shared/Modulith.UI/ServiceCollectionExtensions.cs @@ -25,7 +25,6 @@ private static void RegisterModuleServices(IServiceCollection services, Assembly { if (!TryGetServiceRegistrationMethod(logger, assembly, out var method)) { - logger.LogError("🛑 An error occurred registering services for assembly: '{assembly}'. Skipping registration", assembly.GetName()); return; } From 47e5720b8ba79faadd9325e000c5e5c5e3089077 Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Date: Thu, 3 Oct 2024 16:07:33 -0500 Subject: [PATCH 2/6] Exclude EF Core Migrations from tests. Fixes #60 --- .../NewModule/Modulith.NewModule.Tests/NewModuleTypesShould.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/working/content/modulith/NewModule/Modulith.NewModule.Tests/NewModuleTypesShould.cs b/working/content/modulith/NewModule/Modulith.NewModule.Tests/NewModuleTypesShould.cs index c2fe980..773086e 100644 --- a/working/content/modulith/NewModule/Modulith.NewModule.Tests/NewModuleTypesShould.cs +++ b/working/content/modulith/NewModule/Modulith.NewModule.Tests/NewModuleTypesShould.cs @@ -20,6 +20,8 @@ public void BeInternal() .ResideInNamespace("Modulith.NewModule.*", true) .And() .AreNot([typeof(AssemblyInfo), typeof(NewModuleModuleServiceRegistrar)]) + .And() + .DoNotResideInNamespace("Modulith.NewModule.Data.Migrations") .As("Module types"); var rule = domainTypes.Should().BeInternal(); From 6d60236850a6ea8e7f2de16f441bde885da68975 Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Date: Thu, 3 Oct 2024 16:10:52 -0500 Subject: [PATCH 3/6] Adding reference to Web in Test projects for creating endpoint migrations. --- .../Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj b/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj index 9389bd3..622d839 100644 --- a/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj +++ b/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj @@ -18,6 +18,7 @@ + From 0bda8cc8383e0be44ffdfbccbb5742d576925240 Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Date: Thu, 3 Oct 2024 16:12:42 -0500 Subject: [PATCH 4/6] FastEndpoint version upgrade. Also adding FastEndpoints.Testing and FluentAssertions to test project. Fixes #58 --- working/content/modulith/Modulith.Web/Modulith.Web.csproj | 6 +++--- .../Modulith.NewModule.Tests.csproj | 2 ++ .../NewModule/Modulith.NewModule/Modulith.NewModule.csproj | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/working/content/modulith/Modulith.Web/Modulith.Web.csproj b/working/content/modulith/Modulith.Web/Modulith.Web.csproj index 52e99d9..19d18ba 100644 --- a/working/content/modulith/Modulith.Web/Modulith.Web.csproj +++ b/working/content/modulith/Modulith.Web/Modulith.Web.csproj @@ -21,11 +21,11 @@ - - + + - + diff --git a/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj b/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj index 622d839..ee62cf8 100644 --- a/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj +++ b/working/content/modulith/NewModule/Modulith.NewModule.Tests/Modulith.NewModule.Tests.csproj @@ -11,6 +11,8 @@ + + diff --git a/working/content/modulith/NewModule/Modulith.NewModule/Modulith.NewModule.csproj b/working/content/modulith/NewModule/Modulith.NewModule/Modulith.NewModule.csproj index 1248ac7..e64b395 100644 --- a/working/content/modulith/NewModule/Modulith.NewModule/Modulith.NewModule.csproj +++ b/working/content/modulith/NewModule/Modulith.NewModule/Modulith.NewModule.csproj @@ -6,7 +6,7 @@ - + From 853cfbe884d13d4e67dd6e78db675b58229e26b1 Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Date: Thu, 3 Oct 2024 16:15:43 -0500 Subject: [PATCH 5/6] Adding MediatR to Contracts project. #61 --- .../DddModule/Modulith.DddModule/Modulith.DddModule.csproj | 2 +- .../Modulith.NewModule.Contracts.csproj | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/working/content/modulith/DddModule/Modulith.DddModule/Modulith.DddModule.csproj b/working/content/modulith/DddModule/Modulith.DddModule/Modulith.DddModule.csproj index 9418e20..0a01f0b 100644 --- a/working/content/modulith/DddModule/Modulith.DddModule/Modulith.DddModule.csproj +++ b/working/content/modulith/DddModule/Modulith.DddModule/Modulith.DddModule.csproj @@ -5,7 +5,7 @@ - + diff --git a/working/content/modulith/NewModule/Modulith.NewModule.Contracts/Modulith.NewModule.Contracts.csproj b/working/content/modulith/NewModule/Modulith.NewModule.Contracts/Modulith.NewModule.Contracts.csproj index ba4ddb1..f584041 100644 --- a/working/content/modulith/NewModule/Modulith.NewModule.Contracts/Modulith.NewModule.Contracts.csproj +++ b/working/content/modulith/NewModule/Modulith.NewModule.Contracts/Modulith.NewModule.Contracts.csproj @@ -1,4 +1,5 @@  + From db52d7ebd9af68984e688ed175a8cfa04102b6b7 Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Date: Thu, 3 Oct 2024 16:24:40 -0500 Subject: [PATCH 6/6] Matching variable name on interface --- .../Modulith.NewModule/NewModuleModuleServiceRegistrar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/working/content/modulith/NewModule/Modulith.NewModule/NewModuleModuleServiceRegistrar.cs b/working/content/modulith/NewModule/Modulith.NewModule/NewModuleModuleServiceRegistrar.cs index 01b3b69..c143c0c 100644 --- a/working/content/modulith/NewModule/Modulith.NewModule/NewModuleModuleServiceRegistrar.cs +++ b/working/content/modulith/NewModule/Modulith.NewModule/NewModuleModuleServiceRegistrar.cs @@ -10,7 +10,7 @@ namespace Modulith.NewModule; public class NewModuleModuleServiceRegistrar : IRegisterModuleServices { public static IServiceCollection ConfigureServices(IServiceCollection services, - IConfiguration config) + IConfiguration configuration) { services.AddMediatR( c => c.RegisterServicesFromAssemblies(typeof(AssemblyInfo).Assembly));