Skip to content

Commit e95dee2

Browse files
samgibsonmojryankearsley-moj
authored andcommitted
Register 'MeowUserService' in Meow project (#41)
Currently, the Meow service will fail to save changes to the Audit context due to an unresolved reference to the ICurrentUserService.
1 parent c348828 commit e95dee2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/Aspire/Aspire.AppHost/Extensions/AppExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static IDistributedApplicationBuilder AddDmsServices(
4545
builder.AddDmsService<Import>("Import", rabbit, databases, hostMount);
4646
builder.AddDmsService<Logging>("Logging", rabbit, databases, hostMount);
4747
builder.AddDmsService<Matching_Engine>("Matching-Engine", rabbit, databases, hostMount);
48-
//builder.AddDmsService<Meow>("Meow", rabbit, databases, hostMount);
48+
builder.AddDmsService<Meow>("Meow", rabbit, databases, hostMount).WithExplicitStart();
4949
builder.AddDmsService<Offloc_Cleaner>("Offloc-Cleaner", rabbit, databases, hostMount);
5050
builder.AddDmsService<Offloc_Parser>("Offloc-Parser", rabbit, databases, hostMount);
5151

src/Meow/MeowUserService.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Infrastructure.Middlewares;
2+
3+
namespace Meow;
4+
5+
public class MeowUserService : ICurrentUserService
6+
{
7+
public string? UserName => "MeowUser";
8+
}

src/Meow/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Meow;
1+
using Infrastructure.Middlewares;
2+
using Meow;
23
using Meow.Features.Participants.Handlers;
34
using Rebus.Serialization;
45

@@ -15,6 +16,8 @@
1516
var services = builder.Services;
1617
var configuration = builder.Configuration;
1718

19+
builder.Services.AddScoped<ICurrentUserService, MeowUserService>();
20+
1821
builder.AddDatabaseServices();
1922

2023
services.ConfigureServices(configuration);

0 commit comments

Comments
 (0)