stuff
This commit is contained in:
parent
14fd359ea8
commit
a4ef2b4a20
26 changed files with 331 additions and 78 deletions
|
@ -8,7 +8,7 @@ using Microsoft.Extensions.Hosting;
|
|||
|
||||
namespace Femto.Modules.Media.Application;
|
||||
|
||||
public static class Startup
|
||||
public static class MediaStartup
|
||||
{
|
||||
public static void InitializeMediaModule(this IServiceCollection rootContainer, string connectionString, string storageRoot)
|
||||
{
|
||||
|
@ -22,16 +22,13 @@ public static class Startup
|
|||
builder.UseSnakeCaseNamingConvention();
|
||||
});
|
||||
services.AddTransient<IStorageProvider>(s => new FilesystemStorageProvider(storageRoot));
|
||||
services.AddMediatR(c => c.RegisterServicesFromAssembly(typeof(Startup).Assembly));
|
||||
|
||||
services.AddTransient(
|
||||
typeof(IPipelineBehavior<,>),
|
||||
typeof(SaveChangesPipelineBehaviour<,>)
|
||||
);
|
||||
services.AddMediatR(c => c.RegisterServicesFromAssembly(typeof(MediaStartup).Assembly));
|
||||
services.ConfigureDomainServices<MediaContext>();
|
||||
});
|
||||
|
||||
var host = hostBuilder.Build();
|
||||
|
||||
rootContainer.AddTransient<IMediaModule>(_ => new MediaModule(host));
|
||||
rootContainer.AddHostedService(services => new MediaApplication(host));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue