mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-11 02:20:20 +08:00
.
This commit is contained in:
parent
31db8aa1ba
commit
6da82e39ce
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
@ -0,0 +1 @@
|
||||
npm run format
|
||||
@ -1,8 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0" />
|
||||
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
|
||||
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" />
|
||||
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="all" Version="1.1.118">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Meziantou.Analyzer" PrivateAssets="all" Version="2.0.163">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Roslynator.Analyzers" PrivateAssets="all" Version="4.12.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" PrivateAssets="all" Version="4.12.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Roslynator.Formatting.Analyzers" PrivateAssets="all" Version="4.12.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" PrivateAssets="all" Version="17.11.20">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="AsyncAwaitBestPractices" PrivateAssets="all" Version="8.0.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SerilogAnalyzer" PrivateAssets="all" Version="0.15.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="CSharpGuidelinesAnalyzer" PrivateAssets="all" Version="3.8.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
<AnalysisMode>All</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
3
commitlint.config.js
Normal file
3
commitlint.config.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "8.0.303",
|
||||
"version": "8.0.401",
|
||||
"rollForward": "latestFeature"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1346
package-lock.json
generated
Normal file
1346
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
18
package.json
Normal file
18
package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "booking-microservices",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"author": "Meysam Hadeli",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepare": "husky && dotnet tool restore",
|
||||
"format": "dotnet format booking-microservices-sample.sln --severity error --verbosity detailed",
|
||||
"upgrade-packages": "dotnet outdated --upgrade"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.5.0",
|
||||
"@commitlint/config-conventional": "^19.5.0",
|
||||
"husky": "^9.1.6"
|
||||
}
|
||||
}
|
||||
@ -1,39 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Ardalis.GuardClauses" Version="4.6.0" />
|
||||
<PackageReference Include="Asp.Versioning.Abstractions" Version="8.1.0" />
|
||||
<PackageReference Include="Asp.Versioning.Http" Version="8.1.0" />
|
||||
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
|
||||
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.7" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.8" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="8.0.2" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Elasticsearch" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.EventStore" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="8.0.2" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="8.0.2" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.SQLite.Storage" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="8.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="8.1.0" />
|
||||
<PackageReference Include="Grpc.Core.Testing" Version="2.46.6" />
|
||||
<PackageReference Include="EasyCaching.Core" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.InMemory" Version="1.9.2" />
|
||||
<PackageReference Include="EasyNetQ.Management.Client" Version="2.0.0" />
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="8.0.3" />
|
||||
<PackageReference Include="Figgle" Version="0.5.1" />
|
||||
<PackageReference Include="FluentValidation" Version="11.9.2" />
|
||||
<PackageReference Include="FluentValidation" Version="11.10.0" />
|
||||
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.1" />
|
||||
<PackageReference Include="Npgsql" Version="8.0.3" />
|
||||
<PackageReference Include="Npgsql" Version="8.0.4" />
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.9.0-beta.2" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.9.0-beta.1" />
|
||||
@ -42,25 +35,25 @@
|
||||
<PackageReference Include="IdGen" Version="3.0.7" />
|
||||
<PackageReference Include="Mapster" Version="7.4.0" />
|
||||
<PackageReference Include="Mapster.DependencyInjection" Version="1.0.1" />
|
||||
<PackageReference Include="MediatR" Version="12.4.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
|
||||
<PackageReference Include="MediatR" Version="12.4.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.24.0" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="OpenTelemetry.Contrib.Instrumentation.MassTransit" Version="1.0.0-beta2" />
|
||||
<PackageReference Include="Scrutor" Version="4.2.2" />
|
||||
<PackageReference Include="Sentry.Serilog" Version="4.9.0" />
|
||||
<PackageReference Include="Serilog" Version="4.0.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||
<PackageReference Include="Serilog" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
|
||||
<PackageReference Include="Serilog.Enrichers.Span" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
|
||||
<PackageReference Include="Serilog.Formatting.Elasticsearch" Version="10.0.0" />
|
||||
@ -70,25 +63,25 @@
|
||||
<PackageReference Include="Serilog.Sinks.SpectreConsole" Version="0.3.3" />
|
||||
<PackageReference Include="Serilog.Sinks.XUnit" Version="3.0.5" />
|
||||
<PackageReference Include="Sieve" Version="2.5.5" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.6.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.2" />
|
||||
<PackageReference Include="MassTransit" Version="8.2.3" />
|
||||
<PackageReference Include="MassTransit.RabbitMQ" Version="8.2.3" />
|
||||
<PackageReference Include="Duende.IdentityServer" Version="7.0.5" />
|
||||
<PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="7.0.5" />
|
||||
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.0.5" />
|
||||
<PackageReference Include="Duende.IdentityServer.EntityFramework.Storage" Version="7.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.7" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.7.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.7.3" />
|
||||
<PackageReference Include="MassTransit" Version="8.2.5" />
|
||||
<PackageReference Include="MassTransit.RabbitMQ" Version="8.2.5" />
|
||||
<PackageReference Include="Duende.IdentityServer" Version="7.0.6" />
|
||||
<PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="7.0.6" />
|
||||
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.0.6" />
|
||||
<PackageReference Include="Duende.IdentityServer.EntityFramework.Storage" Version="7.0.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.8" />
|
||||
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
|
||||
<PackageReference Include="System.Linq.Async.Queryable" Version="6.0.1" />
|
||||
<PackageReference Include="Testcontainers" Version="3.9.0" />
|
||||
<PackageReference Include="Testcontainers.EventStoreDb" Version="3.9.0" />
|
||||
<PackageReference Include="Testcontainers.MongoDb" Version="3.9.0" />
|
||||
<PackageReference Include="Testcontainers.PostgreSql" Version="3.9.0" />
|
||||
<PackageReference Include="Testcontainers.RabbitMq" Version="3.9.0" />
|
||||
<PackageReference Include="Testcontainers" Version="3.10.0" />
|
||||
<PackageReference Include="Testcontainers.EventStoreDb" Version="3.10.0" />
|
||||
<PackageReference Include="Testcontainers.MongoDb" Version="3.10.0" />
|
||||
<PackageReference Include="Testcontainers.PostgreSql" Version="3.10.0" />
|
||||
<PackageReference Include="Testcontainers.RabbitMq" Version="3.10.0" />
|
||||
<PackageReference Include="Unchase.Swashbuckle.AspNetCore.Extensions" Version="2.7.1" />
|
||||
<PackageReference Include="Yarp.ReverseProxy" Version="2.1.0" />
|
||||
<PackageReference Include="Yarp.ReverseProxy" Version="2.2.0" />
|
||||
|
||||
<PackageReference Include="prometheus-net" Version="8.2.1" />
|
||||
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1" />
|
||||
@ -99,30 +92,19 @@
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
|
||||
|
||||
<PackageReference Include="EventStore.Client.Grpc.Streams" Version="23.3.3" />
|
||||
<PackageReference Include="EventStore.Client.Grpc.Streams" Version="23.3.5" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
|
||||
|
||||
<PackageReference Include="AutoBogus" Version="2.13.1" />
|
||||
<PackageReference Include="Bogus" Version="35.6.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.0" />
|
||||
<PackageReference Include="Bogus" Version="35.6.1" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.12.1" />
|
||||
<PackageReference Include="Respawn" Version="6.2.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
|
||||
<PackageReference Include="WebMotions.Fake.Authentication.JwtBearer" Version="8.0.1" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" Version="3.27.2" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.64.0" />
|
||||
|
||||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Update="Meziantou.Analyzer" Version="2.0.146" />
|
||||
<PackageReference Update="AsyncFixer" Version="1.6.0" />
|
||||
<PackageReference Update="Roslynator.Analyzers" Version="4.12.0" />
|
||||
<PackageReference Update="Roslynator.CodeAnalysis.Analyzers" Version="4.11.0" />
|
||||
<PackageReference Update="Roslynator.Formatting.Analyzers" Version="4.12.0" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" Version="3.28.1" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.65.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using EasyCaching.Core;
|
||||
using EasyCaching.Core;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using MediatR;
|
||||
using MediatR;
|
||||
|
||||
namespace BuildingBlocks.Core.CQRS;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using MediatR;
|
||||
using MediatR;
|
||||
|
||||
namespace BuildingBlocks.Core.CQRS;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using MediatR;
|
||||
using MediatR;
|
||||
|
||||
namespace BuildingBlocks.Core.CQRS;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using MediatR;
|
||||
using MediatR;
|
||||
|
||||
namespace BuildingBlocks.Core.CQRS;
|
||||
|
||||
|
||||
@ -2,4 +2,4 @@ namespace BuildingBlocks.Core.Event;
|
||||
|
||||
public interface IHaveIntegrationEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Core.Event;
|
||||
namespace BuildingBlocks.Core.Event;
|
||||
|
||||
public interface IInternalCommand : IEvent
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.Core.CQRS;
|
||||
using BuildingBlocks.Core.CQRS;
|
||||
|
||||
namespace BuildingBlocks.Core.Event;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Google.Protobuf;
|
||||
using Google.Protobuf;
|
||||
|
||||
namespace BuildingBlocks.Core.Event;
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ public sealed class EventDispatcher : IEventDispatcher
|
||||
public async Task SendAsync<T>(T @event, Type type = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
where T : IEvent =>
|
||||
await SendAsync(new[] {@event}, type, cancellationToken);
|
||||
await SendAsync(new[] { @event }, type, cancellationToken);
|
||||
|
||||
|
||||
private Task<IReadOnlyList<IIntegrationEvent>> MapDomainEventToIntegrationEventAsync(
|
||||
@ -104,7 +104,8 @@ public sealed class EventDispatcher : IEventDispatcher
|
||||
|
||||
var integrationEvent = _eventMapper.MapToIntegrationEvent(@event);
|
||||
|
||||
if (integrationEvent is null) continue;
|
||||
if (integrationEvent is null)
|
||||
continue;
|
||||
|
||||
integrationEvents.Add(integrationEvent);
|
||||
}
|
||||
@ -129,7 +130,8 @@ public sealed class EventDispatcher : IEventDispatcher
|
||||
|
||||
var integrationEvent = _eventMapper.MapToInternalCommand(@event);
|
||||
|
||||
if (integrationEvent is null) continue;
|
||||
if (integrationEvent is null)
|
||||
continue;
|
||||
|
||||
internalCommands.Add(integrationEvent);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Event;
|
||||
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
|
||||
public abstract record Entity<T> : IEntity<T>
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Event;
|
||||
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
|
||||
public interface IEntity<T> : IEntity
|
||||
{
|
||||
public T Id { get; set; }
|
||||
}
|
||||
|
||||
public interface IEntity: IVersion
|
||||
public interface IEntity : IVersion
|
||||
{
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
public long? CreatedBy { get; set; }
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
namespace BuildingBlocks.Core.Model;
|
||||
|
||||
// For handling optimistic concurrency
|
||||
public interface IVersion
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
|
||||
using Sieve.Models;
|
||||
using Sieve.Services;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
|
||||
public interface IPageList<T>
|
||||
where T : class
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
|
||||
using MediatR;
|
||||
|
||||
public interface IPageQuery<out TResponse> : IPageRequest, IRequest<TResponse>
|
||||
where TResponse : class { }
|
||||
where TResponse : class
|
||||
{ }
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
|
||||
public interface IPageRequest
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
namespace BuildingBlocks.Core.Pagination;
|
||||
|
||||
public record PageList<T>(IReadOnlyList<T> Items, int PageNumber, int PageSize, int TotalCount) : IPageList<T>
|
||||
where T : class
|
||||
|
||||
@ -32,7 +32,8 @@ public abstract class AppDbContextBase : DbContext, IDbContext
|
||||
|
||||
public async Task BeginTransactionAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (_currentTransaction != null) return;
|
||||
if (_currentTransaction != null)
|
||||
return;
|
||||
|
||||
_currentTransaction = await Database.BeginTransactionAsync(IsolationLevel.ReadCommitted, cancellationToken);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace BuildingBlocks.EFCore
|
||||
{
|
||||
public abstract class DesignTimeDbContextFactoryBase<TContext> : IDesignTimeDbContextFactory<TContext> where TContext : DbContext
|
||||
public abstract class DesignTimeDbContextFactoryBase<TContext> : IDesignTimeDbContextFactory<TContext> where TContext : DbContext
|
||||
{
|
||||
public TContext CreateDbContext(string[] args)
|
||||
{
|
||||
@ -59,4 +59,4 @@ namespace BuildingBlocks.EFCore
|
||||
return CreateNewInstance(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,9 +50,9 @@ public class EfTxBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TRe
|
||||
typeof(TRequest).FullName);
|
||||
|
||||
//ref: https://learn.microsoft.com/en-us/ef/core/saving/transactions#using-systemtransactions
|
||||
using var scope = new TransactionScope(TransactionScopeOption.Required,
|
||||
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted },
|
||||
TransactionScopeAsyncFlowOption.Enabled);
|
||||
using var scope = new TransactionScope(TransactionScopeOption.Required,
|
||||
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted },
|
||||
TransactionScopeAsyncFlowOption.Enabled);
|
||||
|
||||
var response = await next();
|
||||
|
||||
|
||||
@ -4,4 +4,4 @@ namespace BuildingBlocks.EFCore
|
||||
{
|
||||
Task SeedAllAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.BackgroundWorkers;
|
||||
|
||||
@ -29,7 +29,7 @@ public static class EventStoreDBConfigExtensions
|
||||
{
|
||||
|
||||
services
|
||||
.AddSingleton(x=>
|
||||
.AddSingleton(x =>
|
||||
{
|
||||
var eventStoreOptions = services.GetOptions<EventStoreOptions>(nameof(EventStoreOptions));
|
||||
return new EventStoreClient(EventStoreClientSettings.Create(eventStoreOptions.ConnectionString));
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Model;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Events
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.EventStoreDB.Serialization;
|
||||
using BuildingBlocks.EventStoreDB.Serialization;
|
||||
using EventStore.Client;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
using BuildingBlocks.Utils;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
|
||||
@ -3,7 +3,7 @@ using MediatR;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
|
||||
public interface IEventHandler<in TEvent>: INotificationHandler<TEvent>
|
||||
public interface IEventHandler<in TEvent> : INotificationHandler<TEvent>
|
||||
where TEvent : IEvent
|
||||
{
|
||||
}
|
||||
|
||||
@ -2,6 +2,6 @@ using BuildingBlocks.Core.Event;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
|
||||
public interface IExternalEvent: IEvent
|
||||
public interface IExternalEvent : IEvent
|
||||
{
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
|
||||
public interface IProjection
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Event;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
|
||||
@ -7,7 +7,7 @@ public record EventMetadata(
|
||||
ulong LogPosition
|
||||
);
|
||||
|
||||
public class StreamEvent: IEvent
|
||||
public class StreamEvent : IEvent
|
||||
{
|
||||
public object Data { get; }
|
||||
public EventMetadata Metadata { get; }
|
||||
@ -19,7 +19,7 @@ public class StreamEvent: IEvent
|
||||
}
|
||||
}
|
||||
|
||||
public class StreamEvent<T>: StreamEvent where T: notnull
|
||||
public class StreamEvent<T> : StreamEvent where T : notnull
|
||||
{
|
||||
public new T Data => (T)base.Data;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using BuildingBlocks.EventStoreDB.Serialization;
|
||||
using EventStore.Client;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Events;
|
||||
|
||||
@ -20,7 +20,7 @@ public class StreamNameMapper
|
||||
|
||||
public static string ToStreamId(Type streamType, object aggregateId, object? tenantId = null)
|
||||
{
|
||||
var tenantPrefix = tenantId != null ? $"{tenantId}_" : "";
|
||||
var tenantPrefix = tenantId != null ? $"{tenantId}_" : "";
|
||||
|
||||
return $"{tenantPrefix}{streamType.Name}-{aggregateId}";
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.EventStoreDB.Events;
|
||||
using BuildingBlocks.EventStoreDB.Events;
|
||||
using BuildingBlocks.EventStoreDB.Serialization;
|
||||
using EventStore.Client;
|
||||
|
||||
|
||||
@ -28,6 +28,6 @@ public static class RepositoryExtensions
|
||||
|
||||
action(entity);
|
||||
|
||||
return await repository.Update(entity, expectedVersion,cancellationToken);
|
||||
return await repository.Update(entity, expectedVersion, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using BuildingBlocks.EventStoreDB.Events;
|
||||
using EventStore.Client;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
@ -18,7 +18,8 @@ public static class JsonObjectContractProvider
|
||||
{
|
||||
var nonDefaultConstructor = GetNonDefaultConstructor(objectType);
|
||||
|
||||
if (nonDefaultConstructor == null) return contract;
|
||||
if (nonDefaultConstructor == null)
|
||||
return contract;
|
||||
|
||||
contract.OverrideCreator = GetObjectConstructor(nonDefaultConstructor);
|
||||
contract.CreatorParameters.Clear();
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Serialization;
|
||||
|
||||
public class NonDefaultConstructorContractResolver: DefaultContractResolver
|
||||
public class NonDefaultConstructorContractResolver : DefaultContractResolver
|
||||
{
|
||||
protected override JsonObjectContract CreateObjectContract(Type objectType)
|
||||
{
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.EventStoreDB.Events;
|
||||
using BuildingBlocks.EventStoreDB.Serialization;
|
||||
using EventStore.Client;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Subscriptions;
|
||||
|
||||
public record CheckpointStored(string SubscriptionId, ulong? Position, DateTime CheckpointedAt): IEvent;
|
||||
public record CheckpointStored(string SubscriptionId, ulong? Position, DateTime CheckpointedAt) : IEvent;
|
||||
|
||||
public class EventStoreDBSubscriptionCheckpointRepository: ISubscriptionCheckpointRepository
|
||||
public class EventStoreDBSubscriptionCheckpointRepository : ISubscriptionCheckpointRepository
|
||||
{
|
||||
private readonly EventStoreClient eventStoreClient;
|
||||
|
||||
@ -37,7 +37,7 @@ public class EventStoreDBSubscriptionCheckpointRepository: ISubscriptionCheckpoi
|
||||
public async ValueTask Store(string subscriptionId, ulong position, CancellationToken ct)
|
||||
{
|
||||
var @event = new CheckpointStored(subscriptionId, position, DateTime.UtcNow);
|
||||
var eventToAppend = new[] {@event.ToJsonEventData()};
|
||||
var eventToAppend = new[] { @event.ToJsonEventData() };
|
||||
var streamName = GetCheckpointStreamName(subscriptionId);
|
||||
|
||||
try
|
||||
|
||||
@ -79,7 +79,8 @@ public class EventStoreDBSubscriptionToAll
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsEventWithEmptyData(resolvedEvent) || IsCheckpointEvent(resolvedEvent)) return;
|
||||
if (IsEventWithEmptyData(resolvedEvent) || IsCheckpointEvent(resolvedEvent))
|
||||
return;
|
||||
|
||||
var streamEvent = resolvedEvent.ToStreamEvent();
|
||||
|
||||
@ -123,7 +124,7 @@ public class EventStoreDBSubscriptionToAll
|
||||
reason
|
||||
);
|
||||
|
||||
if (exception is RpcException {StatusCode: StatusCode.Cancelled})
|
||||
if (exception is RpcException { StatusCode: StatusCode.Cancelled })
|
||||
return;
|
||||
|
||||
Resubscribe();
|
||||
@ -172,7 +173,8 @@ public class EventStoreDBSubscriptionToAll
|
||||
|
||||
private bool IsEventWithEmptyData(ResolvedEvent resolvedEvent)
|
||||
{
|
||||
if (resolvedEvent.Event.Data.Length != 0) return false;
|
||||
if (resolvedEvent.Event.Data.Length != 0)
|
||||
return false;
|
||||
|
||||
logger.LogInformation("Event without data received");
|
||||
return true;
|
||||
@ -180,7 +182,8 @@ public class EventStoreDBSubscriptionToAll
|
||||
|
||||
private bool IsCheckpointEvent(ResolvedEvent resolvedEvent)
|
||||
{
|
||||
if (resolvedEvent.Event.EventType != EventTypeMapper.ToName<CheckpointStored>()) return false;
|
||||
if (resolvedEvent.Event.EventType != EventTypeMapper.ToName<CheckpointStored>())
|
||||
return false;
|
||||
|
||||
logger.LogInformation("Checkpoint event - ignoring");
|
||||
return true;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.EventStoreDB.Subscriptions;
|
||||
namespace BuildingBlocks.EventStoreDB.Subscriptions;
|
||||
|
||||
public interface ISubscriptionCheckpointRepository
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace BuildingBlocks.EventStoreDB.Subscriptions;
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ public class AppException : CustomException
|
||||
{
|
||||
}
|
||||
|
||||
public AppException(string message, System.Exception innerException, int? code = null) : base(message, innerException, code: code)
|
||||
public AppException(string message, System.Exception innerException, int? code = null) : base(message, innerException, code: code)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ namespace BuildingBlocks.Exception
|
||||
public InternalServerException(string message, int? code) : base(message, HttpStatusCode.InternalServerError, code: code) { }
|
||||
|
||||
public InternalServerException(string message, int? code = null, params object[] args)
|
||||
: base(message:String.Format(CultureInfo.CurrentCulture, message, args, HttpStatusCode.InternalServerError, code))
|
||||
: base(message: String.Format(CultureInfo.CurrentCulture, message, args, HttpStatusCode.InternalServerError, code))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BuildingBlocks.Exception;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.EFCore;
|
||||
using BuildingBlocks.EFCore;
|
||||
using BuildingBlocks.Logging;
|
||||
using BuildingBlocks.MassTransit;
|
||||
using BuildingBlocks.Mongo;
|
||||
@ -18,7 +18,8 @@ public static class Extensions
|
||||
{
|
||||
var healthOptions = services.GetOptions<HealthOptions>(nameof(HealthOptions));
|
||||
|
||||
if (!healthOptions.Enabled) return services;
|
||||
if (!healthOptions.Enabled)
|
||||
return services;
|
||||
|
||||
var appOptions = services.GetOptions<AppOptions>(nameof(AppOptions));
|
||||
var postgresOptions = services.GetOptions<PostgresOptions>(nameof(PostgresOptions));
|
||||
@ -51,7 +52,8 @@ public static class Extensions
|
||||
{
|
||||
var healthOptions = app.Configuration.GetOptions<HealthOptions>(nameof(HealthOptions));
|
||||
|
||||
if (!healthOptions.Enabled) return app;
|
||||
if (!healthOptions.Enabled)
|
||||
return app;
|
||||
|
||||
app.UseHealthChecks("/healthz",
|
||||
new HealthCheckOptions
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.HealthCheck;
|
||||
namespace BuildingBlocks.HealthCheck;
|
||||
|
||||
public class HealthOptions
|
||||
{
|
||||
|
||||
@ -13,10 +13,11 @@ public static class JwtExtensions
|
||||
{
|
||||
var jwtOptions = services.GetOptions<JwtBearerOptions>("Jwt");
|
||||
|
||||
services.AddAuthentication(o => {
|
||||
o.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
o.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
})
|
||||
services.AddAuthentication(o =>
|
||||
{
|
||||
o.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
o.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
})
|
||||
.AddCookie(cfg => cfg.SlidingExpiration = true)
|
||||
.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, options =>
|
||||
{
|
||||
@ -27,7 +28,7 @@ public static class JwtExtensions
|
||||
ClockSkew = TimeSpan.FromSeconds(2) // For prevent add default value (5min) to life time token!
|
||||
};
|
||||
options.RequireHttpsMetadata = jwtOptions.RequireHttpsMetadata;
|
||||
options.MetadataAddress= jwtOptions.MetadataAddress;
|
||||
options.MetadataAddress = jwtOptions.MetadataAddress;
|
||||
});
|
||||
|
||||
if (!string.IsNullOrEmpty(jwtOptions.Audience))
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Logging;
|
||||
namespace BuildingBlocks.Logging;
|
||||
|
||||
public class ElasticOptions
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using BuildingBlocks.Web;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -49,7 +49,7 @@ namespace BuildingBlocks.Logging
|
||||
}
|
||||
|
||||
|
||||
if (logOptions?.Sentry is {Enabled: true})
|
||||
if (logOptions?.Sentry is { Enabled: true })
|
||||
{
|
||||
var minimumBreadcrumbLevel = Enum.TryParse<LogEventLevel>(logOptions.Level, true, out var minBreadcrumbLevel)
|
||||
? minBreadcrumbLevel
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Logging;
|
||||
namespace BuildingBlocks.Logging;
|
||||
|
||||
public class FileOptions
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Security.Claims;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Serilog;
|
||||
|
||||
@ -17,7 +17,7 @@ public static class LogEnrichHelper
|
||||
diagnosticContext.Set("Scheme", request.Scheme);
|
||||
|
||||
// Only set it if available. You're not sending sensitive data in a querystring right?!
|
||||
if(request.QueryString.HasValue)
|
||||
if (request.QueryString.HasValue)
|
||||
{
|
||||
diagnosticContext.Set("QueryString", request.QueryString.Value);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Logging
|
||||
namespace BuildingBlocks.Logging
|
||||
{
|
||||
public class LogOptions
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Logging;
|
||||
namespace BuildingBlocks.Logging;
|
||||
|
||||
public class SentryOptions
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.PersistMessageProcessor;
|
||||
using MassTransit;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace BuildingBlocks.PersistMessageProcessor.Data.Configurations;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.EFCore;
|
||||
using BuildingBlocks.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BuildingBlocks.PersistMessageProcessor.Data;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using BuildingBlocks.PersistMessageProcessor.Data;
|
||||
using BuildingBlocks.PersistMessageProcessor.Data;
|
||||
using BuildingBlocks.Web;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Linq.Expressions;
|
||||
using System.Linq.Expressions;
|
||||
using BuildingBlocks.Core.Event;
|
||||
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
|
||||
[Flags]
|
||||
public enum MessageDeliveryType
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
|
||||
public enum MessageStatus
|
||||
{
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
|
||||
using Core.Model;
|
||||
|
||||
public class PersistMessage: IVersion
|
||||
public class PersistMessage : IVersion
|
||||
{
|
||||
public PersistMessage(Guid id, string dataType, string data, MessageDeliveryType deliveryType)
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
namespace BuildingBlocks.PersistMessageProcessor;
|
||||
|
||||
public class PersistMessageOptions
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Linq.Expressions;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text.Json;
|
||||
using Ardalis.GuardClauses;
|
||||
using BuildingBlocks.Core.Event;
|
||||
@ -145,7 +145,8 @@ public class PersistMessageProcessor : IPersistMessageProcessor
|
||||
|
||||
await _publishEndpoint.Publish(data, context =>
|
||||
{
|
||||
foreach (var header in messageEnvelope.Headers) context.Headers.Set(header.Key, header.Value);
|
||||
foreach (var header in messageEnvelope.Headers)
|
||||
context.Headers.Set(header.Key, header.Value);
|
||||
}, cancellationToken);
|
||||
|
||||
_logger.LogInformation(
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Polly;
|
||||
namespace BuildingBlocks.Polly;
|
||||
|
||||
using global::Polly;
|
||||
using Serilog;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Polly;
|
||||
namespace BuildingBlocks.Polly;
|
||||
|
||||
using System.Net;
|
||||
using Ardalis.GuardClauses;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Polly;
|
||||
namespace BuildingBlocks.Polly;
|
||||
|
||||
using System.Net;
|
||||
using Ardalis.GuardClauses;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Polly;
|
||||
namespace BuildingBlocks.Polly;
|
||||
|
||||
using System.Net;
|
||||
using Ardalis.GuardClauses;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Polly;
|
||||
namespace BuildingBlocks.Polly;
|
||||
|
||||
using System.Net;
|
||||
using Ardalis.GuardClauses;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Polly;
|
||||
namespace BuildingBlocks.Polly;
|
||||
|
||||
public class PolicyOptions
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.ProblemDetails;
|
||||
namespace BuildingBlocks.ProblemDetails;
|
||||
|
||||
using Exception;
|
||||
using Grpc.Core;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using Asp.Versioning;
|
||||
using Asp.Versioning.ApiExplorer;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@ -42,8 +42,8 @@ public class ConfigureSwaggerOptions : IConfigureOptions<SwaggerGenOptions>
|
||||
Version = description.ApiVersion.ToString(),
|
||||
Title = _options?.Title ?? "APIs",
|
||||
Description = "An application with Swagger, Swashbuckle, and API versioning.",
|
||||
Contact = new OpenApiContact {Name = "", Email = ""},
|
||||
License = new OpenApiLicense {Name = "MIT", Url = new Uri("https://opensource.org/licenses/MIT")}
|
||||
Contact = new OpenApiContact { Name = "", Email = "" },
|
||||
License = new OpenApiLicense { Name = "MIT", Url = new Uri("https://opensource.org/licenses/MIT") }
|
||||
};
|
||||
|
||||
if (description.IsDeprecated)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@ -33,7 +33,8 @@ public static class ServiceCollectionExtensions
|
||||
{
|
||||
var xmlFile = XmlCommentsFilePath(assembly);
|
||||
|
||||
if (File.Exists(xmlFile)) options.IncludeXmlComments(xmlFile);
|
||||
if (File.Exists(xmlFile))
|
||||
options.IncludeXmlComments(xmlFile);
|
||||
}
|
||||
|
||||
options.AddEnumsWithValuesFixFilters();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Humanizer;
|
||||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||
using Microsoft.OpenApi.Models;
|
||||
@ -59,7 +59,7 @@ namespace BuildingBlocks.Swagger
|
||||
{
|
||||
// REF: https://github.com/Microsoft/aspnet-api-versioning/issues/429#issuecomment-605402330
|
||||
var json = JsonConvert.SerializeObject(description.DefaultValue, description.ModelMetadata
|
||||
.ModelType, new JsonSerializerSettings {ReferenceLoopHandling = ReferenceLoopHandling.Ignore});
|
||||
.ModelType, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
|
||||
parameter.Schema.Default = OpenApiAnyFactory.CreateFromJson(json);
|
||||
}
|
||||
|
||||
|
||||
@ -6,4 +6,4 @@ namespace BuildingBlocks.Swagger
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using Ardalis.GuardClauses;
|
||||
using System.Net;
|
||||
using System.Security.Claims;
|
||||
using Ardalis.GuardClauses;
|
||||
using BuildingBlocks.Core.Event;
|
||||
using BuildingBlocks.Core.Model;
|
||||
using BuildingBlocks.EFCore;
|
||||
@ -20,12 +22,10 @@ using MongoDB.Driver;
|
||||
using NSubstitute;
|
||||
using Respawn;
|
||||
using Serilog;
|
||||
using WebMotions.Fake.Authentication.JwtBearer;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using ILogger = Serilog.ILogger;
|
||||
using System.Net;
|
||||
using System.Security.Claims;
|
||||
using WebMotions.Fake.Authentication.JwtBearer;
|
||||
|
||||
namespace BuildingBlocks.TestBase;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.TestBase;
|
||||
namespace BuildingBlocks.TestBase;
|
||||
|
||||
using Testcontainers.EventStoreDb;
|
||||
using Testcontainers.MongoDb;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace BuildingBlocks.Utils;
|
||||
namespace BuildingBlocks.Utils;
|
||||
|
||||
public static class NoSynchronizationContextScope
|
||||
{
|
||||
@ -9,7 +9,7 @@ public static class NoSynchronizationContextScope
|
||||
return new Disposable(context);
|
||||
}
|
||||
|
||||
public struct Disposable: IDisposable
|
||||
public struct Disposable : IDisposable
|
||||
{
|
||||
private readonly SynchronizationContext? synchronizationContext;
|
||||
|
||||
@ -21,4 +21,4 @@ public static class NoSynchronizationContextScope
|
||||
public void Dispose() =>
|
||||
SynchronizationContext.SetSynchronizationContext(synchronizationContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace BuildingBlocks.Utils;
|
||||
|
||||
|
||||
@ -12,4 +12,4 @@ namespace BuildingBlocks.Validation
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Asp.Versioning;
|
||||
using Asp.Versioning;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace BuildingBlocks.Web;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Asp.Versioning;
|
||||
using Asp.Versioning;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace BuildingBlocks.Web
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Security.Claims;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace BuildingBlocks.Web;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Asp.Versioning.Builder;
|
||||
using Asp.Versioning.Builder;
|
||||
|
||||
namespace BuildingBlocks.Web;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
|
||||
namespace BuildingBlocks.Web;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using BuildingBlocks.Utils;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NSubstitute;
|
||||
|
||||
namespace BuildingBlocks.Web;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user