diff --git a/CQRS.Tests/CQRS.Tests.csproj b/CQRS.Tests/CQRS.Tests.csproj index e8ad574a4..90864e69d 100644 --- a/CQRS.Tests/CQRS.Tests.csproj +++ b/CQRS.Tests/CQRS.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/Core.Marten/Config.cs b/Core.Marten/Config.cs index 0461ee2a6..dcfd1fd98 100644 --- a/Core.Marten/Config.cs +++ b/Core.Marten/Config.cs @@ -4,6 +4,7 @@ using Marten.Events.Daemon.Resiliency; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Weasel.Core; using Weasel.Postgresql; namespace Core.Marten @@ -41,10 +42,10 @@ public static IServiceCollection AddMarten(this IServiceCollection services, ICo }) .InitializeStore(); - if (martenConfig.ShouldRecreateDatabase) - documentStore.Advanced.Clean.CompletelyRemoveAll(); + if (martenConfig.ShouldRecreateDatabase) + documentStore.Advanced.Clean.CompletelyRemoveAll(); - documentStore.Schema.ApplyAllConfiguredChangesToDatabase(); + documentStore.Schema.ApplyAllConfiguredChangesToDatabase(); return services; } diff --git a/Core.Marten/Core.Marten.csproj b/Core.Marten/Core.Marten.csproj index cf4aadfbf..ea1f98f8c 100644 --- a/Core.Marten/Core.Marten.csproj +++ b/Core.Marten/Core.Marten.csproj @@ -8,7 +8,7 @@ - + diff --git a/Core.Tests/Core.Tests.csproj b/Core.Tests/Core.Tests.csproj index 8f6968d60..b6b69ff5e 100644 --- a/Core.Tests/Core.Tests.csproj +++ b/Core.Tests/Core.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj b/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj index 853cfb853..38a0e1ae0 100644 --- a/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj +++ b/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/Marten.Integration.Tests/Marten.Integration.Tests.csproj b/Marten.Integration.Tests/Marten.Integration.Tests.csproj index 5acf24c05..8fbf8f171 100644 --- a/Marten.Integration.Tests/Marten.Integration.Tests.csproj +++ b/Marten.Integration.Tests/Marten.Integration.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/MediatR.Tests/MediatR.Tests.csproj b/MediatR.Tests/MediatR.Tests.csproj index 65e6ef162..164d2f723 100644 --- a/MediatR.Tests/MediatR.Tests.csproj +++ b/MediatR.Tests/MediatR.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/Sample/AsyncProjections/SmartHome.Api/Exceptions/ExceptionHandlingMiddleware.cs b/Sample/AsyncProjections/SmartHome.Api/Exceptions/ExceptionHandlingMiddleware.cs deleted file mode 100644 index b04465aa3..000000000 --- a/Sample/AsyncProjections/SmartHome.Api/Exceptions/ExceptionHandlingMiddleware.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; - -namespace SmartHome.Api.Exceptions -{ - public class ExceptionHandlingMiddleware - { - private readonly RequestDelegate next; - - private readonly ILogger logger; - - public ExceptionHandlingMiddleware(RequestDelegate next, - ILoggerFactory loggerFactory) - { - this.next = next; - logger = loggerFactory.CreateLogger(); - } - - public async Task Invoke(HttpContext context /* other scoped dependencies */) - { - try - { - await next(context); - } - catch (Exception ex) - { - await HandleExceptionAsync(context, ex); - } - } - - private Task HandleExceptionAsync(HttpContext context, Exception exception) - { - logger.LogError(exception, exception.Message); - - var codeInfo = ExceptionToHttpStatusMapper.Map(exception); - - var result = JsonConvert.SerializeObject(new HttpExceptionWrapper((int)codeInfo.Code, codeInfo.Message)); - context.Response.ContentType = "application/json"; - context.Response.StatusCode = (int)codeInfo.Code; - return context.Response.WriteAsync(result); - } - } -} diff --git a/Sample/AsyncProjections/SmartHome.Api/Exceptions/ExceptionToHttpStatusMapper.cs b/Sample/AsyncProjections/SmartHome.Api/Exceptions/ExceptionToHttpStatusMapper.cs deleted file mode 100644 index ccb709bbb..000000000 --- a/Sample/AsyncProjections/SmartHome.Api/Exceptions/ExceptionToHttpStatusMapper.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Net; -using Marten.Exceptions; -using Npgsql; - -namespace SmartHome.Api.Exceptions -{ - public class HttpStatusCodeInfo - { - public HttpStatusCode Code { get; } - public string Message { get; } - - public HttpStatusCodeInfo(HttpStatusCode code, string message) - { - Code = code; - Message = message; - } - - public static HttpStatusCodeInfo Create(HttpStatusCode code, string message) - { - return new HttpStatusCodeInfo(code, message); - } - } - - public static class ExceptionToHttpStatusMapper - { - public static HttpStatusCodeInfo Map(Exception exception) - { - var code = exception switch - { - UnauthorizedAccessException _ => HttpStatusCode.Unauthorized, - NotImplementedException _ => HttpStatusCode.NotImplemented, - InvalidOperationException _ => HttpStatusCode.Conflict, - ArgumentException _ => HttpStatusCode.BadRequest, - ValidationException _ => HttpStatusCode.BadRequest, - MartenCommandException martenCommandException => - (martenCommandException.InnerException as PostgresException)?.SqlState == - PostgresErrorCodes.UniqueViolation - ? HttpStatusCode.Conflict - : HttpStatusCode.InternalServerError, - _ => HttpStatusCode.InternalServerError - }; - - return new HttpStatusCodeInfo(code, (exception.InnerException as PostgresException)?.Message ?? exception.Message); - } - } -} diff --git a/Sample/AsyncProjections/SmartHome.Api/Exceptions/HttpExceptionWrapper.cs b/Sample/AsyncProjections/SmartHome.Api/Exceptions/HttpExceptionWrapper.cs deleted file mode 100644 index fe12e5e3f..000000000 --- a/Sample/AsyncProjections/SmartHome.Api/Exceptions/HttpExceptionWrapper.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SmartHome.Api.Exceptions -{ - public class HttpExceptionWrapper - { - public int StatusCode { get; } - - public string Error { get; } - - public HttpExceptionWrapper(int statusCode, string error) - { - StatusCode = statusCode; - Error = error; - } - } -} diff --git a/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj b/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj index 82a58311d..47798c0c7 100644 --- a/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj +++ b/Sample/AsyncProjections/SmartHome.Api/SmartHome.Api.csproj @@ -12,6 +12,7 @@ + diff --git a/Sample/AsyncProjections/SmartHome.Api/Startup.cs b/Sample/AsyncProjections/SmartHome.Api/Startup.cs index 8c7b7080d..db4153fee 100644 --- a/Sample/AsyncProjections/SmartHome.Api/Startup.cs +++ b/Sample/AsyncProjections/SmartHome.Api/Startup.cs @@ -1,4 +1,5 @@ using Core; +using Core.WebApi.Middlewares.ExceptionHandling; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -6,7 +7,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; -using SmartHome.Api.Exceptions; using SmartHome.Temperature; namespace SmartHome.Api diff --git a/Sample/ECommerce/Payments/Payments.Api.Tests/Payments/RequestingPayment/RequestPaymentsTests.cs b/Sample/ECommerce/Payments/Payments.Api.Tests/Payments/RequestingPayment/RequestPaymentsTests.cs index cc210512b..1eed394e4 100644 --- a/Sample/ECommerce/Payments/Payments.Api.Tests/Payments/RequestingPayment/RequestPaymentsTests.cs +++ b/Sample/ECommerce/Payments/Payments.Api.Tests/Payments/RequestingPayment/RequestPaymentsTests.cs @@ -39,7 +39,7 @@ public RequestPaymentsTestsTests(RequestPaymentsTestsFixture fixture) [Fact] [Trait("Category", "Acceptance")] - public async Task CreateCommand_ShouldReturn_CreatedStatus_With_PaymentId() + public async Task RequestPayment_ShouldReturn_CreatedStatus_With_PaymentId() { var commandResponse = fixture.CommandResponse; commandResponse.EnsureSuccessStatusCode(); @@ -52,7 +52,7 @@ public async Task CreateCommand_ShouldReturn_CreatedStatus_With_PaymentId() [Fact] [Trait("Category", "Acceptance")] - public async Task CreateCommand_ShouldPublish_PaymentInitializedEvent() + public async Task RequestPayment_ShouldPublish_PaymentInitializedEvent() { var createdId = await fixture.CommandResponse.GetResultFromJson(); @@ -68,7 +68,7 @@ public async Task CreateCommand_ShouldPublish_PaymentInitializedEvent() // [Fact] // [Trait("Category", "Acceptance")] - // public async Task CreateCommand_ShouldCreate_Payment() + // public async Task RequestPayment_ShouldCreate_Payment() // { // var createdId = await fixture.CommandResponse.GetResultFromJSON(); // diff --git a/Sample/ECommerce/Shipments/Shipments.Api.Tests/Packages/SendPackageTests.cs b/Sample/ECommerce/Shipments/Shipments.Api.Tests/Packages/SendPackageTests.cs index 3f0af8673..6fd4aa49a 100644 --- a/Sample/ECommerce/Shipments/Shipments.Api.Tests/Packages/SendPackageTests.cs +++ b/Sample/ECommerce/Shipments/Shipments.Api.Tests/Packages/SendPackageTests.cs @@ -16,13 +16,13 @@ namespace Shipments.Api.Tests.Packages { public class SendPackageFixture: ApiFixture { - protected override string ApiUrl { get; } = "/api/Shipments"; + protected override string ApiUrl => "/api/Shipments"; public readonly Guid OrderId = Guid.NewGuid(); public readonly DateTime TimeBeforeSending = DateTime.UtcNow; - public readonly List ProductItems = new List + public readonly List ProductItems = new() { new ProductItem { diff --git a/Sample/ECommerce/Shipments/Shipments.Api/appsettings.Development.json b/Sample/ECommerce/Shipments/Shipments.Api/appsettings.Development.json index f42db70ed..855fb99f2 100644 --- a/Sample/ECommerce/Shipments/Shipments.Api/appsettings.Development.json +++ b/Sample/ECommerce/Shipments/Shipments.Api/appsettings.Development.json @@ -6,8 +6,5 @@ "System": "Information", "Microsoft": "Information" } - }, - "ConnectionStrings": { - "ClientsDatabase": "PORT = 5432; HOST = localhost; TIMEOUT = 15; POOLING = True; MINPOOLSIZE = 1; MAXPOOLSIZE = 100; COMMANDTIMEOUT = 20; DATABASE = 'postgres'; PASSWORD = 'Password12!'; USER ID = 'postgres'" } } diff --git a/Sample/ECommerce/Shipments/Shipments/Config.cs b/Sample/ECommerce/Shipments/Shipments/Config.cs index f27dab738..5820b4562 100644 --- a/Sample/ECommerce/Shipments/Shipments/Config.cs +++ b/Sample/ECommerce/Shipments/Shipments/Config.cs @@ -21,13 +21,17 @@ public static IServiceCollection AddShipmentsModule(this IServiceCollection serv private static IServiceCollection AddEntityFramework(this IServiceCollection services, IConfiguration config) { return services.AddDbContext( - options => options.UseNpgsql(config.GetConnectionString("ShipmentsDatabase"))); + options => options.UseNpgsql("name=ConnectionStrings:ShipmentsDatabase")); } public static void ConfigureShipmentsModule(this IServiceProvider serviceProvider) { - // Kids, don't try this at production - serviceProvider.GetRequiredService().Database.Migrate(); + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"; + + if (environment == "Development") + { + serviceProvider.GetRequiredService().Database.Migrate(); + } } } } diff --git a/Sample/ECommerce/Shipments/Shipments/Shipments.csproj b/Sample/ECommerce/Shipments/Shipments/Shipments.csproj index 9a96ca6ef..d452a873a 100644 --- a/Sample/ECommerce/Shipments/Shipments/Shipments.csproj +++ b/Sample/ECommerce/Shipments/Shipments/Shipments.csproj @@ -6,6 +6,10 @@ true + + + + @@ -17,9 +21,13 @@ all runtime; build; native; contentfiles; analyzers + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - diff --git a/Sample/ECommerce/Shipments/Shipments/Storage/ClientsDbContextFactory.cs b/Sample/ECommerce/Shipments/Shipments/Storage/ShipmentsDbContextFactory.cs similarity index 77% rename from Sample/ECommerce/Shipments/Shipments/Storage/ClientsDbContextFactory.cs rename to Sample/ECommerce/Shipments/Shipments/Storage/ShipmentsDbContextFactory.cs index e634d619c..2d800a5e3 100644 --- a/Sample/ECommerce/Shipments/Shipments/Storage/ClientsDbContextFactory.cs +++ b/Sample/ECommerce/Shipments/Shipments/Storage/ShipmentsDbContextFactory.cs @@ -2,13 +2,12 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; -using Shipments.Storage; -namespace EventSourcing.Sample.Clients.Storage +namespace Shipments.Storage { - internal class ClientsDbContextFactory: IDesignTimeDbContextFactory + internal class ShipmentsDbContextFactory: IDesignTimeDbContextFactory { - public ClientsDbContextFactory() + public ShipmentsDbContextFactory() { } @@ -27,9 +26,9 @@ public ShipmentsDbContext CreateDbContext(string[] args) .SetBasePath(AppContext.BaseDirectory) .AddJsonFile("appsettings.json") .AddJsonFile($"appsettings.{environmentName}.json", optional: true, reloadOnChange: false) - //.AddEnvironmentVariables() + .AddEnvironmentVariables() .Build() - .GetConnectionString("ClientsDatabase"); + .GetConnectionString("ShipmentsDatabase"); optionsBuilder.UseNpgsql(connectionString); diff --git a/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj b/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj index cfeef8ad8..1966447f2 100644 --- a/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj @@ -7,7 +7,7 @@ - + diff --git a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj b/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj index 75f942d89..b301efd71 100644 --- a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj @@ -17,7 +17,7 @@ - + @@ -37,10 +37,4 @@ - - - - Always - - diff --git a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/appsettings.json b/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/appsettings.json deleted file mode 100644 index 568f28299..000000000 --- a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/appsettings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*", - - "EventStore": { - "ConnectionString": "PORT = 5432; HOST = localhost; TIMEOUT = 15; POOLING = True; MINPOOLSIZE = 1; MAXPOOLSIZE = 100; COMMANDTIMEOUT = 20; DATABASE = 'postgres'; PASSWORD = 'Password12!'; USER ID = 'postgres'", - "WriteModelSchema": "MeetingsManagementWrite", - "ReadModelSchema": "MeetingsManagementRead" - } -} diff --git a/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj b/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj index 470ae8843..61c964c1b 100644 --- a/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj @@ -8,7 +8,7 @@ - + diff --git a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj index 6fdae6c76..29dc3e760 100644 --- a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj +++ b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj @@ -17,7 +17,7 @@ - + @@ -36,10 +36,4 @@ - - - - Always - - diff --git a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/appsettings.Development.json b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/appsettings.Development.json deleted file mode 100644 index e203e9407..000000000 --- a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/appsettings.json b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/appsettings.json deleted file mode 100644 index 1df5e3417..000000000 --- a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/appsettings.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*", - - "elasticsearch": { - "index": "meetings", - "url": "http://localhost:9200/" - }, - - "KafkaConsumer": { - "ConsumerConfig": { - "GroupId": "MeetingsSearch", - "BootstrapServers": "localhost:9092", - "AutoOffsetReset": "Earliest" - }, - "Topics": [ "MeetingsManagement" ] - }, - - "KafkaProducer": { - "ConsumerConfig": { - "BootstrapServers": "localhost:9092" - }, - "Topic": "MeetingsSearch" - } -} diff --git a/Sample/Tickets/Tickets.Api/Exceptions/ExceptionHandlingMiddleware.cs b/Sample/Tickets/Tickets.Api/Exceptions/ExceptionHandlingMiddleware.cs deleted file mode 100644 index 524d6bed9..000000000 --- a/Sample/Tickets/Tickets.Api/Exceptions/ExceptionHandlingMiddleware.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; - -namespace Tickets.Api.Exceptions -{ - public class ExceptionHandlingMiddleware - { - private readonly RequestDelegate next; - - private readonly ILogger logger; - - public ExceptionHandlingMiddleware(RequestDelegate next, - ILoggerFactory loggerFactory) - { - this.next = next; - logger = loggerFactory.CreateLogger(); - } - - public async Task Invoke(HttpContext context /* other scoped dependencies */) - { - try - { - await next(context); - } - catch (Exception ex) - { - await HandleExceptionAsync(context, ex); - } - } - - private Task HandleExceptionAsync(HttpContext context, Exception exception) - { - logger.LogError(exception, exception.Message); - - var codeInfo = ExceptionToHttpStatusMapper.Map(exception); - - var result = JsonConvert.SerializeObject(new HttpExceptionWrapper((int)codeInfo.Code, codeInfo.Message)); - context.Response.ContentType = "application/json"; - context.Response.StatusCode = (int)codeInfo.Code; - return context.Response.WriteAsync(result); - } - } -} diff --git a/Sample/Tickets/Tickets.Api/Exceptions/ExceptionToHttpStatusMapper.cs b/Sample/Tickets/Tickets.Api/Exceptions/ExceptionToHttpStatusMapper.cs deleted file mode 100644 index 88732841f..000000000 --- a/Sample/Tickets/Tickets.Api/Exceptions/ExceptionToHttpStatusMapper.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Net; -using Marten.Exceptions; -using Npgsql; - -namespace Tickets.Api.Exceptions -{ - public class HttpStatusCodeInfo - { - public HttpStatusCode Code { get; } - public string Message { get; } - - public HttpStatusCodeInfo(HttpStatusCode code, string message) - { - Code = code; - Message = message; - } - - public static HttpStatusCodeInfo Create(HttpStatusCode code, string message) - { - return new HttpStatusCodeInfo(code, message); - } - } - - public static class ExceptionToHttpStatusMapper - { - public static HttpStatusCodeInfo Map(Exception exception) - { - var code = exception switch - { - UnauthorizedAccessException _ => HttpStatusCode.Unauthorized, - NotImplementedException _ => HttpStatusCode.NotImplemented, - InvalidOperationException _ => HttpStatusCode.Conflict, - ArgumentException _ => HttpStatusCode.BadRequest, - ValidationException _ => HttpStatusCode.BadRequest, - MartenCommandException martenCommandException => - (martenCommandException.InnerException as PostgresException)?.SqlState == - PostgresErrorCodes.UniqueViolation - ? HttpStatusCode.Conflict - : HttpStatusCode.InternalServerError, - _ => HttpStatusCode.InternalServerError - }; - - return new HttpStatusCodeInfo(code, (exception.InnerException as PostgresException)?.Message ?? exception.Message); - } - } -} diff --git a/Sample/Tickets/Tickets.Api/Exceptions/HttpExceptionWrapper.cs b/Sample/Tickets/Tickets.Api/Exceptions/HttpExceptionWrapper.cs deleted file mode 100644 index f13852e15..000000000 --- a/Sample/Tickets/Tickets.Api/Exceptions/HttpExceptionWrapper.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Tickets.Api.Exceptions -{ - public class HttpExceptionWrapper - { - public int StatusCode { get; } - - public string Error { get; } - - public HttpExceptionWrapper(int statusCode, string error) - { - StatusCode = statusCode; - Error = error; - } - } -} diff --git a/Sample/Tickets/Tickets.Api/Startup.cs b/Sample/Tickets/Tickets.Api/Startup.cs index fe8294111..2f3fd2b44 100644 --- a/Sample/Tickets/Tickets.Api/Startup.cs +++ b/Sample/Tickets/Tickets.Api/Startup.cs @@ -1,4 +1,5 @@ using Core; +using Core.WebApi.Middlewares.ExceptionHandling; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -6,7 +7,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; -using Tickets.Api.Exceptions; namespace Tickets.Api { diff --git a/Sample/Tickets/Tickets.Api/Tickets.Api.csproj b/Sample/Tickets/Tickets.Api/Tickets.Api.csproj index de5c2778e..9b0174944 100644 --- a/Sample/Tickets/Tickets.Api/Tickets.Api.csproj +++ b/Sample/Tickets/Tickets.Api/Tickets.Api.csproj @@ -12,6 +12,7 @@ + diff --git a/Sample/Tickets/Tickets.Api/appsettings.json b/Sample/Tickets/Tickets.Api/appsettings.json index d7ed651b9..4d7f1cb80 100644 --- a/Sample/Tickets/Tickets.Api/appsettings.json +++ b/Sample/Tickets/Tickets.Api/appsettings.json @@ -8,8 +8,8 @@ }, "EventStore": { "ConnectionString": "PORT = 5432; HOST = localhost; TIMEOUT = 15; POOLING = True; MINPOOLSIZE = 1; MAXPOOLSIZE = 100; COMMANDTIMEOUT = 20; DATABASE = 'postgres'; PASSWORD = 'Password12!'; USER ID = 'postgres'", - "WriteModelSchema": "meetings_management_write", - "ReadModelSchema": "meetings_management_read" + "WriteModelSchema": "tickets_management_write", + "ReadModelSchema": "tickets_management_read" }, "AllowedHosts": "*" } diff --git a/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj b/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj index 027f81d25..82e936eee 100644 --- a/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj +++ b/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj b/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj +++ b/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj b/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj +++ b/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj b/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj +++ b/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj b/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj +++ b/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj b/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj +++ b/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj b/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj +++ b/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj b/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj +++ b/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj b/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj +++ b/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj b/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj index 2e06ad0f2..302a83702 100644 --- a/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj +++ b/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj b/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj +++ b/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj index a6da80fcf..171fe226c 100644 --- a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj +++ b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj index c112d306f..547d37462 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj b/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj index 0694a0cbd..2a83172a1 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj @@ -9,7 +9,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj b/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj index fce9d0545..7a4f70195 100644 --- a/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj +++ b/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj @@ -9,7 +9,7 @@ - + diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index f5e9ce6d1..e22da7b3e 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -13,17 +13,6 @@ services: networks: - pg_network - pgadmin: - image: dpage/pgadmin4 - container_name: pgadmin - environment: - PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@pgadmin.org} - PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} - ports: - - "${PGADMIN_PORT:-5050}:80" - networks: - - pg_network - ####################################################### # EventStoreDB ####################################################### @@ -73,17 +62,6 @@ services: networks: - es_network - kibana: - image: docker.elastic.co/kibana/kibana:7.13.3 - environment: - - ELASTICSEARCH_HOSTS=http://elastic_search:9200 - ports: - - "5601:5601" - networks: - - es_network - depends_on: - - elasticsearch - networks: es_network: driver: bridge @@ -94,7 +72,6 @@ networks: volumes: postgres: - pgadmin: eventstore-volume-data: eventstore-volume-logs: elastic-data: