-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d7a242
commit 22114d6
Showing
129 changed files
with
592 additions
and
331 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Source/Modules/Channels/Features/Modules.Channels.Features.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Channels/IntegrationEvents/Modules.Channels.IntegrationEvents.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Channels/Web/Client/Modules.Channels.Web.Client.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Channels/Web/DTOs/Modules.Channels.Web.Shared.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Channels/Web/Server/Modules.Channels.Web.Server.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/LandingPages/Web/Server/Modules.LandingPages.Server.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Subscription/Features/Modules.Subscription.Features/Modules.Subscriptions.Features.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Subscription/IntegrationEvents/Modules.Subscriptions.IntegrationEvents.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Subscription/Web/Client/Modules.Subscriptions.Web.Client.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Subscription/Web/DTOs/Modules.Subscriptions.Web.Shared.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/Subscription/Web/Server/Modules.Subscriptions.Web.Server.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
....TenantIdentity.Features/Aggregates/UserAggregate/Application/Queries/GetClaimsForUser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tIdentity/Features/Modules.TenantIdentity.Features/Modules.TenantIdentity.Features.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../Modules/TenantIdentity/IntegrationEvents/Modules.TenantIdentity.IntegrationEvents.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/TenantIdentity/Web/Client/Modules.TenantIdentity.Web.Client.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/TenantIdentity/Web/DTOs/Modules.TenantIdentity.Web.Shared.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Modules/TenantIdentity/Web/Server/Modules.TenantIdentity.Web.Server.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
Source/Shared/Features/CQRS/DomainEvent/DomainEventDispatcher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Shared/Features/CQRS/DomainEvent/IDomainEventDispatcher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Shared/Features/CQRS/IntegrationEvent/IIntegrationEventDispatcher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Shared/Features/CQRS/IntegrationEvent/IIntegrationEventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/Shared/Features/CQRS/IntegrationEvent/IntegrationEventDispatcher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using SendGrid.Helpers.Errors.Model; | ||
using Shared.Kernel.BuildingBlocks.Auth.DomainKernel; | ||
using Shared.Kernel.BuildingBlocks; | ||
using Shared.SharedKernel.Interfaces; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Shared.Features.Domain | ||
{ | ||
public class AggregateRoot : Entity, ITenantIdentifiable | ||
{ | ||
[NotMapped] | ||
public IExecutionContext ExecutionContext { get; set; } | ||
public virtual Guid TenantId { get; set; } | ||
|
||
public void ThrowIfCallerIsNotInRole(TenantRole role) | ||
{ | ||
if (ExecutionContext.TenantRole != role) | ||
{ | ||
throw new UnauthorizedException(); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
...ce/Shared/Features/DomainKernel/Entity.cs → Source/Shared/Features/Domain/Entity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../Features/DomainKernel/DomainException.cs → ...ures/Domain/Exceptions/DomainException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...xceptions/InvalidEntityDeleteException.cs → ...xceptions/InvalidEntityDeleteException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Shared.Features.Domain | ||
{ | ||
public interface IDomainEvent | ||
{ | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ared/Features/DomainKernel/ValueObject.cs → Source/Shared/Features/Domain/ValueObject.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Shared.Features.DomainKernel | ||
namespace Shared.Features.Domain | ||
{ | ||
public abstract class ValueObject | ||
{ | ||
|
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
Source/Shared/Features/DomainKernel/Interfaces/IDomainEvent.cs
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
Source/Shared/Features/DomainKernel/Interfaces/IIntegrationEvent.cs
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
Source/Shared/Features/EFCore/ExecutionContextInterceptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.EntityFrameworkCore.Diagnostics; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Shared.Features.Domain; | ||
using Shared.Kernel.BuildingBlocks; | ||
|
||
namespace Shared.Features.EFCore | ||
{ | ||
public class ExecutionContextInterceptor : SaveChangesInterceptor | ||
{ | ||
public object InitializedInstance( | ||
MaterializationInterceptionData materializationData, | ||
object instance) | ||
{ | ||
if (instance is AggregateRoot aggregateRoot) | ||
{ | ||
aggregateRoot.ExecutionContext = materializationData | ||
.Context | ||
.GetService<IExecutionContext>(); | ||
} | ||
|
||
return instance; | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
Source/Shared/Features/EFCore/MultiTenancy/MultiTenancyEntityConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Shared.Features.EFCore.Configuration; | ||
using Shared.Features.Modules.Configuration; | ||
|
||
namespace Shared.Features.EFCore | ||
{ | ||
public static class Registrator | ||
{ | ||
public static IServiceCollection AddEFCore(this IServiceCollection services, IConfiguration configuration) | ||
{ | ||
services.RegisterModuleConfiguration<EFCoreConfiguration, EFCoreConfigurationValidator>(configuration); | ||
services.AddScoped<TransactionScopeMiddleware>(); | ||
|
||
return services; | ||
} | ||
|
||
public static IApplicationBuilder UseEFCoreMiddleware(this IApplicationBuilder app) | ||
{ | ||
app.UseMiddleware<TransactionScopeMiddleware>(); | ||
|
||
return app; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Source/Shared/Features/EFCore/TransactionScopeMiddleware.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using System.Transactions; | ||
|
||
namespace Shared.Features.EFCore | ||
{ | ||
public class TransactionScopeMiddleware : IMiddleware | ||
{ | ||
public async Task InvokeAsync(HttpContext context, RequestDelegate next) | ||
{ | ||
using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) | ||
{ | ||
await next(context); | ||
|
||
scope.Complete(); | ||
} | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Source/Shared/Features/Modules/Configuration/IModuleConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Shared.Features.Modules.Configuration | ||
{ | ||
public interface IModuleConfiguration | ||
{ | ||
} | ||
} |
Oops, something went wrong.