mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-15 05:25:36 +08:00
feat: add modular monolith source
This commit is contained in:
parent
27d25aa47d
commit
d278e36fd2
@ -67,12 +67,12 @@ public static class SharedInfrastructureExtensions
|
||||
partitionKey: httpContext.User.Identity?.Name ??
|
||||
httpContext.Request.Headers.Host.ToString(),
|
||||
factory: partition => new FixedWindowRateLimiterOptions
|
||||
{
|
||||
AutoReplenishment = true,
|
||||
PermitLimit = 10,
|
||||
QueueLimit = 0,
|
||||
Window = TimeSpan.FromMinutes(1)
|
||||
}));
|
||||
{
|
||||
AutoReplenishment = true,
|
||||
PermitLimit = 10,
|
||||
QueueLimit = 0,
|
||||
Window = TimeSpan.FromMinutes(1)
|
||||
}));
|
||||
});
|
||||
|
||||
builder.AddCustomObservability();
|
||||
|
||||
@ -70,7 +70,7 @@ where TResponse : notnull
|
||||
|
||||
using var scope = new TransactionScope(
|
||||
TransactionScopeOption.Required,
|
||||
new TransactionOptions {IsolationLevel = IsolationLevel.ReadCommitted},
|
||||
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted },
|
||||
TransactionScopeAsyncFlowOption.Enabled);
|
||||
|
||||
await _eventDispatcher.SendAsync(
|
||||
|
||||
@ -49,12 +49,12 @@ public class IdentityDataSeeder : IDataSeeder
|
||||
{
|
||||
if (await _roleManager.RoleExistsAsync(Constants.Role.Admin) == false)
|
||||
{
|
||||
await _roleManager.CreateAsync(new Role {Name = Constants.Role.Admin});
|
||||
await _roleManager.CreateAsync(new Role { Name = Constants.Role.Admin });
|
||||
}
|
||||
|
||||
if (await _roleManager.RoleExistsAsync(Constants.Role.User) == false)
|
||||
{
|
||||
await _roleManager.CreateAsync(new Role {Name = Constants.Role.User});
|
||||
await _roleManager.CreateAsync(new Role { Name = Constants.Role.User });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ where TResponse : notnull
|
||||
|
||||
using var scope = new TransactionScope(
|
||||
TransactionScopeOption.Required,
|
||||
new TransactionOptions {IsolationLevel = IsolationLevel.ReadCommitted},
|
||||
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted },
|
||||
TransactionScopeAsyncFlowOption.Enabled);
|
||||
|
||||
await _eventDispatcher.SendAsync(
|
||||
|
||||
@ -9,7 +9,7 @@ namespace BuildingBlocks.Mongo
|
||||
public static class Extensions
|
||||
{
|
||||
public static IServiceCollection AddMongoDbContext<TContext>(
|
||||
this WebApplicationBuilder builder, Action<MongoOptions>? configurator = null)
|
||||
this WebApplicationBuilder builder, Action<MongoOptions>? configurator = null)
|
||||
where TContext : MongoDbContext
|
||||
{
|
||||
return builder.Services.AddMongoDbContext<TContext, TContext>(builder.Configuration, configurator);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user