From 2ee4a7012d214cb84711b3c9910dc98bbf246151 Mon Sep 17 00:00:00 2001 From: Oskar Dudycz Date: Sun, 5 Mar 2023 14:49:34 +0100 Subject: [PATCH] Switched Elastic client from NEST to Elastic.Clients.Elasticsearch Bumped also other dependencies (OpenTelemetry, Marten, etc.) --- Core.ElasticSearch/Config.cs | 10 ++--- Core.ElasticSearch/Core.ElasticSearch.csproj | 2 +- .../Projections/ElasticSearchProjection.cs | 9 ++-- .../Repository/ElasticSearchExtensions.cs | 44 +++++++++---------- .../Repository/ElasticSearchRepository.cs | 12 ++--- .../Core.EventStoreDB.Tests.csproj | 2 +- Core.Kafka.Tests/Core.Kafka.Tests.csproj | 2 +- Core.Marten/Core.Marten.csproj | 3 +- .../Subscriptions/MartenSubscription.cs | 2 + Core.Tests/Core.Tests.csproj | 4 +- Core/Core.csproj | 4 +- Core/OpenTelemetry/TelemetryExtensions.cs | 3 +- .../EventSourcing.Integration.Tests.csproj | 4 +- .../CompositeIds/CompositeIdsTests.cs | 2 +- .../OutOfOrder/OutOfOrderProjectionsTest.cs | 2 +- .../Projections/AggregationProjectionsTest.cs | 2 +- .../EventStore/Stream/StreamLoading.cs | 2 +- .../EventStore/Stream/StreamStarting.cs | 2 +- .../General/StoreInitializationTests.cs | 10 ++--- .../Marten.Integration.Tests.csproj | 4 +- .../DocumentSessionProvider.cs | 4 +- .../Carts.Api.Tests/Carts.Api.Tests.csproj | 2 +- .../Carts/Carts.Api/Carts.Api.csproj | 2 +- .../Carts/Carts.Tests/Carts.Tests.csproj | 2 +- .../Orders.Api.Tests/Orders.Api.Tests.csproj | 2 +- .../Orders/Orders.Api/Orders.Api.csproj | 2 +- .../Orders/Orders.Tests/Orders.Tests.csproj | 2 +- .../Payments.Api.Tests.csproj | 2 +- .../Payments/Payments.Api/Payments.Api.csproj | 2 +- .../Payments.Tests/Payments.Tests.csproj | 2 +- .../Shipments.Api.Tests.csproj | 2 +- .../Shipments.Api/Shipments.Api.csproj | 2 +- .../Shipments.Tests/Shipments.Tests.csproj | 2 +- .../EventPipelines.MediatR.csproj | 2 +- .../EventPipelines.Tests.csproj | 2 +- .../Configuration.cs | 8 ++-- .../Carts.Api.Tests/Carts.Api.Tests.csproj | 2 +- .../Carts/Carts.Api/Carts.Api.csproj | 2 +- .../Carts/Carts.Tests/Carts.Tests.csproj | 2 +- .../ECommerce.Api.Tests.csproj | 2 +- .../Simple/ECommerce.Api/ECommerce.Api.csproj | 2 +- .../EventsVersioning.Tests.csproj | 2 +- .../Helpdesk.Api.Tests.csproj | 2 +- .../Helpdesk.Api/Core/Kafka/KafkaProducer.cs | 2 + .../Helpdesk/Helpdesk.Api/Helpdesk.Api.csproj | 4 +- .../HotelManagement.Tests.csproj | 2 +- .../HotelManagement/HotelManagement.csproj | 2 +- .../MeetingsManagement.Api.csproj | 5 +-- ...MeetingsManagement.IntegrationTests.csproj | 4 +- .../MeetingsManagement.csproj | 2 +- .../MeetingsSearch.Api.csproj | 3 +- .../MeetingsSearch.IntegrationTests.csproj | 4 +- .../MeetingsSearch/Config.cs | 5 ++- .../Tickets.Api.Tests.csproj | 2 +- Sample/Tickets/Tickets.Api/Tickets.Api.csproj | 2 +- .../Tickets.Tests/Tickets.Tests.csproj | 4 +- .../Warehouse.Api.Tests.csproj | 2 +- .../01-CreateStreamsTable.csproj | 4 +- .../02-CreateEventsTable.csproj | 4 +- .../03-CreateAppendEventFunction.csproj | 4 +- .../03-OptimisticConcurrency.csproj | 4 +- .../04-EventStoreMethods.csproj | 4 +- .../05-StreamAggregation.csproj | 4 +- .../06-TimeTraveling/06-TimeTraveling.csproj | 4 +- .../07-AggregateAndRepository.csproj | 4 +- .../08-Snapshots/08-Snapshots.csproj | 4 +- .../09-Projections/09-Projections.csproj | 4 +- .../10-ProjectionsWithMarten.csproj | 4 +- .../Exercise10ProjectionsWithMarten.cs | 2 +- .../EventStoreBasics.Tests.csproj | 4 +- .../Exercise10ProjectionsWithMarten.cs | 2 +- .../EventStoreBasics/EventStoreBasics.csproj | 2 +- .../BuildYourOwnEventStore/Tools/Tools.csproj | 2 +- .../01-EventsDefinition.csproj | 4 +- .../02-GettingStateFromEvents.csproj | 4 +- .../03-AppendingEvents.Marten.csproj | 4 +- .../04-AppendingEvents.EventStoreDB.csproj | 2 +- .../05-GettingStateFromEvents.Marten.csproj | 4 +- ...GettingStateFromEvents.EventStoreDB.csproj | 2 +- .../07-BusinessLogic/07-BusinessLogic.csproj | 2 +- .../08-BusinessLogic.Marten.csproj | 4 +- .../09-BusinessLogic.EventStoreDB.csproj | 2 +- .../10-OptimisticConcurrency.Marten.csproj | 4 +- ...-OptimisticConcurrency.EventStoreDB.csproj | 2 +- .../12-Projections.SingleStream.csproj | 4 +- ...rojections.SingleStream.Idempotency.csproj | 4 +- ...ns.SingleStream.EventualConsistency.csproj | 4 +- .../01-EventsDefinition.csproj | 4 +- .../02-GettingStateFromEvents.csproj | 4 +- .../03-AppendingEvents.Marten.csproj | 4 +- .../04-AppendingEvents.EventStoreDB.csproj | 2 +- .../05-GettingStateFromEvents.Marten.csproj | 4 +- ...GettingStateFromEvents.EventStoreDB.csproj | 2 +- .../07-BusinessLogic/07-BusinessLogic.csproj | 2 +- .../08-BusinessLogic.Marten.csproj | 4 +- .../09-BusinessLogic.EventStoreDB.csproj | 2 +- .../10-OptimisticConcurrency.Marten.csproj | 4 +- ...-OptimisticConcurrency.EventStoreDB.csproj | 2 +- .../12-Projections.SingleStream.csproj | 4 +- ...rojections.SingleStream.Idempotency.csproj | 4 +- ...ns.SingleStream.EventualConsistency.csproj | 4 +- 101 files changed, 185 insertions(+), 185 deletions(-) diff --git a/Core.ElasticSearch/Config.cs b/Core.ElasticSearch/Config.cs index 79f6fb830..5cc32b118 100644 --- a/Core.ElasticSearch/Config.cs +++ b/Core.ElasticSearch/Config.cs @@ -1,7 +1,7 @@ using Core.Configuration; +using Elastic.Clients.Elasticsearch; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Nest; namespace Core.ElasticSearch; @@ -16,17 +16,17 @@ public static class ElasticSearchConfigExtensions private const string DefaultConfigKey = "ElasticSearch"; public static IServiceCollection AddElasticsearch( - this IServiceCollection services, IConfiguration configuration, Action? config = null) + this IServiceCollection services, IConfiguration configuration, Action? config = null) { var elasticSearchConfig = configuration.GetRequiredConfig(DefaultConfigKey); - var settings = new ConnectionSettings(new Uri(elasticSearchConfig.Url)) + var settings = new ElasticsearchClientSettings(new Uri(elasticSearchConfig.Url)) .DefaultIndex(elasticSearchConfig.DefaultIndex); config?.Invoke(settings); - var client = new ElasticClient(settings); + var client = new ElasticsearchClient(settings); - return services.AddSingleton(client); + return services.AddSingleton(client); } } diff --git a/Core.ElasticSearch/Core.ElasticSearch.csproj b/Core.ElasticSearch/Core.ElasticSearch.csproj index 39eb1ec7d..776960b0c 100644 --- a/Core.ElasticSearch/Core.ElasticSearch.csproj +++ b/Core.ElasticSearch/Core.ElasticSearch.csproj @@ -6,7 +6,7 @@ - + diff --git a/Core.ElasticSearch/Projections/ElasticSearchProjection.cs b/Core.ElasticSearch/Projections/ElasticSearchProjection.cs index 70e81c9c0..c9bd35547 100644 --- a/Core.ElasticSearch/Projections/ElasticSearchProjection.cs +++ b/Core.ElasticSearch/Projections/ElasticSearchProjection.cs @@ -1,9 +1,8 @@ using Core.ElasticSearch.Indices; using Core.Events; using Core.Projections; -using Elasticsearch.Net; +using Elastic.Clients.Elasticsearch; using Microsoft.Extensions.DependencyInjection; -using Nest; namespace Core.ElasticSearch.Projections; @@ -11,11 +10,11 @@ public class ElasticSearchProjection : IEventHandler getId; public ElasticSearchProjection( - IElasticClient elasticClient, + ElasticsearchClient elasticClient, Func getId ) { @@ -50,7 +49,7 @@ public static IServiceCollection Project(this IServiceCollection { services.AddTransient>>(sp => { - var session = sp.GetRequiredService(); + var session = sp.GetRequiredService(); return new ElasticSearchProjection(session, getId); }); diff --git a/Core.ElasticSearch/Repository/ElasticSearchExtensions.cs b/Core.ElasticSearch/Repository/ElasticSearchExtensions.cs index 78ece0f03..3a5076645 100644 --- a/Core.ElasticSearch/Repository/ElasticSearchExtensions.cs +++ b/Core.ElasticSearch/Repository/ElasticSearchExtensions.cs @@ -1,31 +1,31 @@ using System.Collections.Concurrent; -using Nest; +using Elastic.Clients.Elasticsearch; namespace Core.ElasticSearch.Repository; +public static class ElasticSearchRepository +{ + public static async Task Find(this ElasticsearchClient elasticClient, string id, CancellationToken ct) + where T : class => + (await elasticClient.GetAsync(id, cancellationToken: ct).ConfigureAwait(false))?.Source; - public static class ElasticSearchRepository - { - public static async Task Find(this IElasticClient elasticClient, string id, CancellationToken ct) - where T: class => - (await elasticClient.GetAsync(id, ct: ct).ConfigureAwait(false))?.Source; - - public static async Task Upsert(this IElasticClient elasticClient, string id, T entity, CancellationToken ct) - where T: class => - await elasticClient.UpdateAsync(id, - u => u.Doc(entity).Upsert(entity).Index(ToIndexName()), - ct - ).ConfigureAwait(false); + public static async Task Upsert(this ElasticsearchClient elasticClient, string id, T entity, + CancellationToken ct) + where T : class => + await elasticClient.UpdateAsync(ToIndexName(), id, + u => u.Doc(entity).Upsert(entity), + ct + ).ConfigureAwait(false); - private static readonly ConcurrentDictionary TypeNameMap = new(); + private static readonly ConcurrentDictionary TypeNameMap = new(); - private static string ToIndexName() + private static string ToIndexName() + { + var indexType = typeof(TIndex); + return TypeNameMap.GetOrAdd(indexType, _ => { - var indexType = typeof(TIndex); - return TypeNameMap.GetOrAdd(indexType, _ => - { - var modulePrefix = indexType.Namespace!.Split(".").First(); - return $"{modulePrefix}-{indexType.Name}".ToLower(); - }); - } + var modulePrefix = indexType.Namespace!.Split(".").First(); + return $"{modulePrefix}-{indexType.Name}".ToLower(); + }); } +} diff --git a/Core.ElasticSearch/Repository/ElasticSearchRepository.cs b/Core.ElasticSearch/Repository/ElasticSearchRepository.cs index d5d09251a..e5b1d5d73 100644 --- a/Core.ElasticSearch/Repository/ElasticSearchRepository.cs +++ b/Core.ElasticSearch/Repository/ElasticSearchRepository.cs @@ -1,5 +1,5 @@ using Core.ElasticSearch.Indices; -using Nest; +using Elastic.Clients.Elasticsearch; using IAggregate = Core.Aggregates.IAggregate; namespace Core.ElasticSearch.Repository; @@ -15,10 +15,10 @@ namespace Core.ElasticSearch.Repository; public class ElasticSearchRepository: IElasticSearchRepository where T : class, IAggregate, new() { - private readonly IElasticClient elasticClient; + private readonly ElasticsearchClient elasticClient; public ElasticSearchRepository( - IElasticClient elasticClient + ElasticsearchClient elasticClient ) { this.elasticClient = elasticClient ?? throw new ArgumentNullException(nameof(elasticClient)); @@ -26,7 +26,7 @@ IElasticClient elasticClient public async Task Find(Guid id, CancellationToken cancellationToken) { - var response = await elasticClient.GetAsync(id, ct: cancellationToken).ConfigureAwait(false); + var response = await elasticClient.GetAsync(id, cancellationToken).ConfigureAwait(false); return response?.Source; } @@ -37,11 +37,11 @@ public Task Add(T aggregate, CancellationToken cancellationToken) public Task Update(T aggregate, CancellationToken cancellationToken) { - return elasticClient.UpdateAsync(aggregate.Id, i => i.Doc(aggregate).Index(IndexNameMapper.ToIndexName()), cancellationToken); + return elasticClient.UpdateAsync(IndexNameMapper.ToIndexName(), aggregate.Id, i => i.Doc(aggregate), cancellationToken); } public Task Delete(T aggregate, CancellationToken cancellationToken) { - return elasticClient.DeleteAsync(aggregate.Id, ct: cancellationToken); + return elasticClient.DeleteAsync(aggregate.Id, cancellationToken); } } diff --git a/Core.EventStoreDB.Tests/Core.EventStoreDB.Tests.csproj b/Core.EventStoreDB.Tests/Core.EventStoreDB.Tests.csproj index 87e7bec6e..5855b731e 100644 --- a/Core.EventStoreDB.Tests/Core.EventStoreDB.Tests.csproj +++ b/Core.EventStoreDB.Tests/Core.EventStoreDB.Tests.csproj @@ -17,7 +17,7 @@ - + all diff --git a/Core.Kafka.Tests/Core.Kafka.Tests.csproj b/Core.Kafka.Tests/Core.Kafka.Tests.csproj index ad0941b33..a1e701d9d 100644 --- a/Core.Kafka.Tests/Core.Kafka.Tests.csproj +++ b/Core.Kafka.Tests/Core.Kafka.Tests.csproj @@ -16,7 +16,7 @@ - + all diff --git a/Core.Marten/Core.Marten.csproj b/Core.Marten/Core.Marten.csproj index 494b227ca..8cec064ba 100644 --- a/Core.Marten/Core.Marten.csproj +++ b/Core.Marten/Core.Marten.csproj @@ -5,8 +5,7 @@ - - + diff --git a/Core.Marten/Subscriptions/MartenSubscription.cs b/Core.Marten/Subscriptions/MartenSubscription.cs index 1f6392f44..16bf5e14b 100644 --- a/Core.Marten/Subscriptions/MartenSubscription.cs +++ b/Core.Marten/Subscriptions/MartenSubscription.cs @@ -44,6 +44,8 @@ CancellationToken ct throw; } } + + public bool EnableDocumentTrackingDuringRebuilds { get; set; } } public interface IMartenEventsConsumer diff --git a/Core.Tests/Core.Tests.csproj b/Core.Tests/Core.Tests.csproj index 24cb1136d..f3d4221cc 100644 --- a/Core.Tests/Core.Tests.csproj +++ b/Core.Tests/Core.Tests.csproj @@ -16,8 +16,8 @@ - - + + all diff --git a/Core/Core.csproj b/Core/Core.csproj index 9db17e263..5dfb9eeda 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -13,10 +13,10 @@ - + - + diff --git a/Core/OpenTelemetry/TelemetryExtensions.cs b/Core/OpenTelemetry/TelemetryExtensions.cs index 85de61e59..89054ba94 100644 --- a/Core/OpenTelemetry/TelemetryExtensions.cs +++ b/Core/OpenTelemetry/TelemetryExtensions.cs @@ -21,7 +21,8 @@ OpenTelemetryOptions options Activity.DefaultIdFormat = ActivityIdFormat.W3C; services - .AddOpenTelemetryTracing(builder => + .AddOpenTelemetry() + .WithTracing(builder => { options.ConfigureTracerProvider(builder .AddSource(ActivitySourceProvider.DefaultSourceName) diff --git a/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj b/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj index 10a9298c7..1f60fc497 100644 --- a/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj +++ b/EventSourcing.Integration.Tests/EventSourcing.Integration.Tests.csproj @@ -12,8 +12,8 @@ - - + + all diff --git a/Marten.Integration.Tests/CompositeIds/CompositeIdsTests.cs b/Marten.Integration.Tests/CompositeIds/CompositeIdsTests.cs index 49ec48546..e0f22fe66 100644 --- a/Marten.Integration.Tests/CompositeIds/CompositeIdsTests.cs +++ b/Marten.Integration.Tests/CompositeIds/CompositeIdsTests.cs @@ -261,7 +261,7 @@ protected override IDocumentSession CreateSession(Action? setStore options.Projections.SelfAggregate(); }); - return store.OpenSession(); + return store.LightweightSession(); } [Fact] diff --git a/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs b/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs index 0d991157b..4a532a4a2 100644 --- a/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs +++ b/Marten.Integration.Tests/EventStore/Aggregate/OutOfOrder/OutOfOrderProjectionsTest.cs @@ -58,7 +58,7 @@ protected override IDocumentSession CreateSession(Action? setStore options.Projections.SelfAggregate(); }); - return store.OpenSession(); + return store.LightweightSession(); } [Fact] diff --git a/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs b/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs index 5285f445e..ac8e9f2b4 100644 --- a/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs +++ b/Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs @@ -84,7 +84,7 @@ protected override IDocumentSession CreateSession(Action? setStore options.Projections.Add(new IssueDescriptionsProjection()); }); - return store.OpenSession(); + return store.LightweightSession(); } [Fact] diff --git a/Marten.Integration.Tests/EventStore/Stream/StreamLoading.cs b/Marten.Integration.Tests/EventStore/Stream/StreamLoading.cs index b531abc92..afb97027e 100644 --- a/Marten.Integration.Tests/EventStore/Stream/StreamLoading.cs +++ b/Marten.Integration.Tests/EventStore/Stream/StreamLoading.cs @@ -70,7 +70,7 @@ public void GivenExistingStreamWithOneEvent_WhenStreamIsLoadedByEventType_ThenIt //Then @event.Should().NotBeNull(); - @event.Id.Should().Be(eventId); + @event!.Id.Should().Be(eventId); } [Fact] diff --git a/Marten.Integration.Tests/EventStore/Stream/StreamStarting.cs b/Marten.Integration.Tests/EventStore/Stream/StreamStarting.cs index 27ba3a152..05cd4cdea 100644 --- a/Marten.Integration.Tests/EventStore/Stream/StreamStarting.cs +++ b/Marten.Integration.Tests/EventStore/Stream/StreamStarting.cs @@ -75,7 +75,7 @@ public void GivenOneEvent_WhenEventsArePublishedWithStreamId_ThenEventsAreSavedW var streamState = EventStore.FetchStreamState(streamId); streamState.Should().NotBeNull(); - streamState.Version.Should().Be(1); + streamState!.Version.Should().Be(1); } [Fact] diff --git a/Marten.Integration.Tests/General/StoreInitializationTests.cs b/Marten.Integration.Tests/General/StoreInitializationTests.cs index 3e0f2e213..cd74488bb 100644 --- a/Marten.Integration.Tests/General/StoreInitializationTests.cs +++ b/Marten.Integration.Tests/General/StoreInitializationTests.cs @@ -81,7 +81,7 @@ public void GivenProperConnectionString_WhenDocumentSessionIsCreatedAndTransacti options.Events.DatabaseSchemaName = Settings.SchemaName; }); - using var session = store.OpenSession(); + using var session = store.LightweightSession(); using var transaction = session.Connection!.BeginTransaction(); ConnectionShouldBeEstablished(store); @@ -93,11 +93,9 @@ public void GivenProperConnectionString_WhenDocumentSessionIsCreatedAndTransacti private static void ConnectionShouldBeEstablished(IDocumentStore store) { - using (var session = store.OpenSession()) - { - var result = session.Query("SELECT 1"); + using var session = store.LightweightSession(); + var result = session.Query("SELECT 1"); - result.Should().NotBeNull(); - } + result.Should().NotBeNull(); } } diff --git a/Marten.Integration.Tests/Marten.Integration.Tests.csproj b/Marten.Integration.Tests/Marten.Integration.Tests.csproj index 4ae282af4..dc3db082e 100644 --- a/Marten.Integration.Tests/Marten.Integration.Tests.csproj +++ b/Marten.Integration.Tests/Marten.Integration.Tests.csproj @@ -18,10 +18,10 @@ - + - + all diff --git a/Marten.Integration.Tests/TestsInfrastructure/DocumentSessionProvider.cs b/Marten.Integration.Tests/TestsInfrastructure/DocumentSessionProvider.cs index 7dd9e2a86..1c68d0269 100644 --- a/Marten.Integration.Tests/TestsInfrastructure/DocumentSessionProvider.cs +++ b/Marten.Integration.Tests/TestsInfrastructure/DocumentSessionProvider.cs @@ -6,6 +6,6 @@ public static IDocumentSession Get(string? schemaName = null, Action - + diff --git a/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj b/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj index 9d7f38e0c..6b038d770 100644 --- a/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj +++ b/Sample/ECommerce/Carts/Carts.Api/Carts.Api.csproj @@ -13,7 +13,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj b/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj index 817c8d889..ba207d575 100644 --- a/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj +++ b/Sample/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj b/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj index e47ec76a0..ea74a4bff 100644 --- a/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj +++ b/Sample/ECommerce/Orders/Orders.Api.Tests/Orders.Api.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj b/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj index ab72b206b..4ae3b09cf 100644 --- a/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj +++ b/Sample/ECommerce/Orders/Orders.Api/Orders.Api.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj b/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj index 71272ea9b..dfb6fec77 100644 --- a/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj +++ b/Sample/ECommerce/Orders/Orders.Tests/Orders.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj b/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj index 683935072..9f60f8e01 100644 --- a/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj +++ b/Sample/ECommerce/Payments/Payments.Api.Tests/Payments.Api.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj b/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj index 2f44b8193..8a05681cc 100644 --- a/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj +++ b/Sample/ECommerce/Payments/Payments.Api/Payments.Api.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj b/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj index 2436139aa..5fdbb15df 100644 --- a/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj +++ b/Sample/ECommerce/Payments/Payments.Tests/Payments.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj b/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj index 283f97c77..97fd177d8 100644 --- a/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj +++ b/Sample/ECommerce/Shipments/Shipments.Api.Tests/Shipments.Api.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj b/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj index c52c2cab3..aced89cae 100644 --- a/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj +++ b/Sample/ECommerce/Shipments/Shipments.Api/Shipments.Api.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj b/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj index 6624fb935..52d120faf 100644 --- a/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj +++ b/Sample/ECommerce/Shipments/Shipments.Tests/Shipments.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/Sample/EventPipelines/EventPipelines.MediatR/EventPipelines.MediatR.csproj b/Sample/EventPipelines/EventPipelines.MediatR/EventPipelines.MediatR.csproj index 66c16e45b..b1dff2007 100644 --- a/Sample/EventPipelines/EventPipelines.MediatR/EventPipelines.MediatR.csproj +++ b/Sample/EventPipelines/EventPipelines.MediatR/EventPipelines.MediatR.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/EventPipelines/EventPipelines.Tests/EventPipelines.Tests.csproj b/Sample/EventPipelines/EventPipelines.Tests/EventPipelines.Tests.csproj index 2229d9aba..6e209176c 100644 --- a/Sample/EventPipelines/EventPipelines.Tests/EventPipelines.Tests.csproj +++ b/Sample/EventPipelines/EventPipelines.Tests/EventPipelines.Tests.csproj @@ -6,7 +6,7 @@ - + all diff --git a/Sample/EventStoreDB/DataAnalytics/MarketBasketAnalytics/CartAbandonmentRateAnalysis/Configuration.cs b/Sample/EventStoreDB/DataAnalytics/MarketBasketAnalytics/CartAbandonmentRateAnalysis/Configuration.cs index 1e07208fe..447988705 100644 --- a/Sample/EventStoreDB/DataAnalytics/MarketBasketAnalytics/CartAbandonmentRateAnalysis/Configuration.cs +++ b/Sample/EventStoreDB/DataAnalytics/MarketBasketAnalytics/CartAbandonmentRateAnalysis/Configuration.cs @@ -1,10 +1,10 @@ using Core.ElasticSearch.Repository; using Core.Events; using Core.EventStoreDB.Events; +using Elastic.Clients.Elasticsearch; using EventStore.Client; using MarketBasketAnalytics.Carts; using Microsoft.Extensions.DependencyInjection; -using Nest; namespace MarketBasketAnalytics.CartAbandonmentRateAnalysis { @@ -30,12 +30,12 @@ await eventStore.Append( }) .AddEventHandler(async (sp, shoppingCartConfirmed, ct) => { - var elastic = sp.GetRequiredService(); + var elastic = sp.GetRequiredService(); var summaryId = CartAbandonmentRatesSummary.SummaryId; var summary = await CartAbandonmentRatesSummary.Handle( - token => elastic.Find(summaryId, token), + async token => (await elastic.GetAsync(summaryId, cancellationToken: token)).Source, shoppingCartConfirmed, ct ); @@ -44,7 +44,7 @@ await eventStore.Append( }) .AddEventHandler(async (sp, shoppingCartAbandoned, ct) => { - var elastic = sp.GetRequiredService(); + var elastic = sp.GetRequiredService(); var summaryId = CartAbandonmentRatesSummary.SummaryId; diff --git a/Sample/EventStoreDB/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj b/Sample/EventStoreDB/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj index aeb16f34a..6fbb5bbc1 100644 --- a/Sample/EventStoreDB/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj +++ b/Sample/EventStoreDB/ECommerce/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/Sample/EventStoreDB/ECommerce/Carts/Carts.Api/Carts.Api.csproj b/Sample/EventStoreDB/ECommerce/Carts/Carts.Api/Carts.Api.csproj index faf05401f..79d2b73ae 100644 --- a/Sample/EventStoreDB/ECommerce/Carts/Carts.Api/Carts.Api.csproj +++ b/Sample/EventStoreDB/ECommerce/Carts/Carts.Api/Carts.Api.csproj @@ -5,7 +5,7 @@ - + diff --git a/Sample/EventStoreDB/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj b/Sample/EventStoreDB/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj index 8941b9d68..715f58aa5 100644 --- a/Sample/EventStoreDB/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj +++ b/Sample/EventStoreDB/ECommerce/Carts/Carts.Tests/Carts.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/Sample/EventStoreDB/Simple/ECommerce.Api.Tests/ECommerce.Api.Tests.csproj b/Sample/EventStoreDB/Simple/ECommerce.Api.Tests/ECommerce.Api.Tests.csproj index cb70b14e4..af81a1b74 100644 --- a/Sample/EventStoreDB/Simple/ECommerce.Api.Tests/ECommerce.Api.Tests.csproj +++ b/Sample/EventStoreDB/Simple/ECommerce.Api.Tests/ECommerce.Api.Tests.csproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Sample/EventStoreDB/Simple/ECommerce.Api/ECommerce.Api.csproj b/Sample/EventStoreDB/Simple/ECommerce.Api/ECommerce.Api.csproj index 452a19fce..510511d6c 100644 --- a/Sample/EventStoreDB/Simple/ECommerce.Api/ECommerce.Api.csproj +++ b/Sample/EventStoreDB/Simple/ECommerce.Api/ECommerce.Api.csproj @@ -9,7 +9,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Sample/EventsVersioning/EventsVersioning.Tests/EventsVersioning.Tests.csproj b/Sample/EventsVersioning/EventsVersioning.Tests/EventsVersioning.Tests.csproj index d7653d9e0..6638335a6 100644 --- a/Sample/EventsVersioning/EventsVersioning.Tests/EventsVersioning.Tests.csproj +++ b/Sample/EventsVersioning/EventsVersioning.Tests/EventsVersioning.Tests.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/Helpdesk/Helpdesk.Api.Tests/Helpdesk.Api.Tests.csproj b/Sample/Helpdesk/Helpdesk.Api.Tests/Helpdesk.Api.Tests.csproj index 0af5ca4b1..561cd5582 100644 --- a/Sample/Helpdesk/Helpdesk.Api.Tests/Helpdesk.Api.Tests.csproj +++ b/Sample/Helpdesk/Helpdesk.Api.Tests/Helpdesk.Api.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/Sample/Helpdesk/Helpdesk.Api/Core/Kafka/KafkaProducer.cs b/Sample/Helpdesk/Helpdesk.Api/Core/Kafka/KafkaProducer.cs index d4c28773e..af769cbbb 100644 --- a/Sample/Helpdesk/Helpdesk.Api/Core/Kafka/KafkaProducer.cs +++ b/Sample/Helpdesk/Helpdesk.Api/Core/Kafka/KafkaProducer.cs @@ -27,6 +27,8 @@ public async Task ApplyAsync(IDocumentOperations operations, IReadOnlyList streams) => throw new NotImplementedException("Producer should be only used in the AsyncDaemon"); diff --git a/Sample/Helpdesk/Helpdesk.Api/Helpdesk.Api.csproj b/Sample/Helpdesk/Helpdesk.Api/Helpdesk.Api.csproj index 4fb4796bc..ad694e57f 100644 --- a/Sample/Helpdesk/Helpdesk.Api/Helpdesk.Api.csproj +++ b/Sample/Helpdesk/Helpdesk.Api/Helpdesk.Api.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/Sample/HotelManagement/HotelManagement.Tests/HotelManagement.Tests.csproj b/Sample/HotelManagement/HotelManagement.Tests/HotelManagement.Tests.csproj index 4b41566b0..5959dc668 100644 --- a/Sample/HotelManagement/HotelManagement.Tests/HotelManagement.Tests.csproj +++ b/Sample/HotelManagement/HotelManagement.Tests/HotelManagement.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/Sample/HotelManagement/HotelManagement/HotelManagement.csproj b/Sample/HotelManagement/HotelManagement/HotelManagement.csproj index 190456e75..a30ec07bd 100644 --- a/Sample/HotelManagement/HotelManagement/HotelManagement.csproj +++ b/Sample/HotelManagement/HotelManagement/HotelManagement.csproj @@ -5,7 +5,7 @@ - + diff --git a/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj b/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj index fa4d19bd4..539c708e9 100644 --- a/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement.Api/MeetingsManagement.Api.csproj @@ -5,9 +5,8 @@ - - - + + diff --git a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj b/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj index 80c9b4f6d..7d11e0694 100644 --- a/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement.IntegrationTests/MeetingsManagement.IntegrationTests.csproj @@ -13,11 +13,11 @@ - + - + diff --git a/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj b/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj index 607ccb2ee..5d464147e 100644 --- a/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj +++ b/Sample/MeetingsManagement/MeetingsManagement/MeetingsManagement.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj b/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj index 633a04ef2..a916aec86 100644 --- a/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj +++ b/Sample/MeetingsManagement/MeetingsSearch.Api/MeetingsSearch.Api.csproj @@ -5,8 +5,7 @@ - - + diff --git a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj index 5c0b44820..c9136b39f 100644 --- a/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj +++ b/Sample/MeetingsManagement/MeetingsSearch.IntegrationTests/MeetingsSearch.IntegrationTests.csproj @@ -13,11 +13,11 @@ - + - + diff --git a/Sample/MeetingsManagement/MeetingsSearch/Config.cs b/Sample/MeetingsManagement/MeetingsSearch/Config.cs index 9804bd595..3579b2cde 100644 --- a/Sample/MeetingsManagement/MeetingsSearch/Config.cs +++ b/Sample/MeetingsManagement/MeetingsSearch/Config.cs @@ -2,6 +2,7 @@ using MeetingsSearch.Meetings; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using static Core.ElasticSearch.Indices.IndexNameMapper; namespace MeetingsSearch; @@ -13,8 +14,8 @@ public static IServiceCollection AddMeetingsSearch(this IServiceCollection servi { settings .DefaultMappingFor(m => m - .PropertyName(p => p.Id, "id") - .PropertyName(p => p.Name, "name") + .IdProperty(p => p.Id) + .IndexName(ToIndexName()) ); }) .AddMeeting(); diff --git a/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj b/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj index 4ec62ffc9..af07656b0 100644 --- a/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj +++ b/Sample/Tickets/Tickets.Api.Tests/Tickets.Api.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/Sample/Tickets/Tickets.Api/Tickets.Api.csproj b/Sample/Tickets/Tickets.Api/Tickets.Api.csproj index 721cd698d..6a741d359 100644 --- a/Sample/Tickets/Tickets.Api/Tickets.Api.csproj +++ b/Sample/Tickets/Tickets.Api/Tickets.Api.csproj @@ -6,7 +6,7 @@ - + diff --git a/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj b/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj index 61dca6e73..b25fe8282 100644 --- a/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj +++ b/Sample/Tickets/Tickets.Tests/Tickets.Tests.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj b/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj index 996efbaad..cb8678682 100644 --- a/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj +++ b/Sample/Warehouse/Warehouse.Api.Tests/Warehouse.Api.Tests.csproj @@ -6,7 +6,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj b/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj +++ b/Workshops/BuildYourOwnEventStore/01-CreateStreamsTable/01-CreateStreamsTable.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj b/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj +++ b/Workshops/BuildYourOwnEventStore/02-CreateEventsTable/02-CreateEventsTable.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj b/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj +++ b/Workshops/BuildYourOwnEventStore/03-CreateAppendEventFunction/03-CreateAppendEventFunction.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj b/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj +++ b/Workshops/BuildYourOwnEventStore/03-OptimisticConcurrency/03-OptimisticConcurrency.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj b/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj +++ b/Workshops/BuildYourOwnEventStore/04-EventStoreMethods/04-EventStoreMethods.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj b/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj +++ b/Workshops/BuildYourOwnEventStore/05-StreamAggregation/05-StreamAggregation.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj b/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj +++ b/Workshops/BuildYourOwnEventStore/06-TimeTraveling/06-TimeTraveling.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj b/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj +++ b/Workshops/BuildYourOwnEventStore/07-AggregateAndRepository/07-AggregateAndRepository.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj b/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj +++ b/Workshops/BuildYourOwnEventStore/08-Snapshots/08-Snapshots.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj b/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj +++ b/Workshops/BuildYourOwnEventStore/09-Projections/09-Projections.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj index 981486245..75418dd17 100644 --- a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj +++ b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/10-ProjectionsWithMarten.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs index 0a87c82d5..2afec55a6 100644 --- a/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs +++ b/Workshops/BuildYourOwnEventStore/10-ProjectionsWithMarten/Exercise10ProjectionsWithMarten.cs @@ -170,7 +170,7 @@ public Exercise10ProjectionsWithMarten() options.Projections.Add(); }); - documentSession = store.OpenSession(); + documentSession = store.LightweightSession(); userRepository = new MartenRepository(documentSession); orderRepository = new MartenRepository(documentSession); diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj index 0ccd418b3..186ef1fa6 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/EventStoreBasics.Tests.csproj @@ -6,8 +6,8 @@ - - + + all diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs index 49716fde9..7d1057dd7 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics.Tests/Exercise10ProjectionsWithMarten.cs @@ -181,7 +181,7 @@ public Exercise10ProjectionsWithMarten() // options.Projections.Add(new UserDashboardProjection()); }); - documentSession = store.OpenSession(); + documentSession = store.LightweightSession(); userRepository = new MartenRepository(documentSession); orderRepository = new MartenRepository(documentSession); diff --git a/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj b/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj index 0c4724af0..b8f412021 100644 --- a/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj +++ b/Workshops/BuildYourOwnEventStore/EventStoreBasics/EventStoreBasics.csproj @@ -7,7 +7,7 @@ - + diff --git a/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj b/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj index c0a31c171..3b8def96b 100644 --- a/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj +++ b/Workshops/BuildYourOwnEventStore/Tools/Tools.csproj @@ -8,7 +8,7 @@ - + diff --git a/Workshops/IntroductionToEventSourcing/01-EventsDefinition/01-EventsDefinition.csproj b/Workshops/IntroductionToEventSourcing/01-EventsDefinition/01-EventsDefinition.csproj index 10c2ca625..979ae3357 100644 --- a/Workshops/IntroductionToEventSourcing/01-EventsDefinition/01-EventsDefinition.csproj +++ b/Workshops/IntroductionToEventSourcing/01-EventsDefinition/01-EventsDefinition.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj b/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj index 566ba2a6c..9fd1542c3 100644 --- a/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj +++ b/Workshops/IntroductionToEventSourcing/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj b/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj index ea830d1cb..6ac2c37dc 100644 --- a/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj index 03b156f3b..0f36b0bb5 100644 --- a/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj index 566ba2a6c..9fd1542c3 100644 --- a/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj index 52c0cdbbb..3fabdc5ee 100644 --- a/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/07-BusinessLogic/07-BusinessLogic.csproj b/Workshops/IntroductionToEventSourcing/07-BusinessLogic/07-BusinessLogic.csproj index e9b6d86da..35fba072e 100644 --- a/Workshops/IntroductionToEventSourcing/07-BusinessLogic/07-BusinessLogic.csproj +++ b/Workshops/IntroductionToEventSourcing/07-BusinessLogic/07-BusinessLogic.csproj @@ -7,7 +7,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj index 2d3f75d39..43d39cb5d 100644 --- a/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj index f75b2a815..6d6fecbed 100644 --- a/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj index cb27903ce..89c2c2973 100644 --- a/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj index 73cbf7e4f..b1f618ce6 100644 --- a/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/12-Projections.SingleStream/12-Projections.SingleStream.csproj b/Workshops/IntroductionToEventSourcing/12-Projections.SingleStream/12-Projections.SingleStream.csproj index 566ba2a6c..9fd1542c3 100644 --- a/Workshops/IntroductionToEventSourcing/12-Projections.SingleStream/12-Projections.SingleStream.csproj +++ b/Workshops/IntroductionToEventSourcing/12-Projections.SingleStream/12-Projections.SingleStream.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj b/Workshops/IntroductionToEventSourcing/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj index 566ba2a6c..9fd1542c3 100644 --- a/Workshops/IntroductionToEventSourcing/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj +++ b/Workshops/IntroductionToEventSourcing/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj b/Workshops/IntroductionToEventSourcing/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj index 566ba2a6c..9fd1542c3 100644 --- a/Workshops/IntroductionToEventSourcing/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj +++ b/Workshops/IntroductionToEventSourcing/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/01-EventsDefinition.csproj b/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/01-EventsDefinition.csproj index 5f508d402..1cff3bbc0 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/01-EventsDefinition.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/01-EventsDefinition/01-EventsDefinition.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj index 725cd5e1f..9cc38b3b3 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/02-GettingStateFromEvents/02-GettingStateFromEvents.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj b/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj index b8a62bfc9..9d6bdbe12 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/03-AppendingEvents.Marten/03-AppendingEvents.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj index 8c48d44de..8c798a68e 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/04-AppendingEvents.EventStoreDB/04-AppendingEvents.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj index 725cd5e1f..9cc38b3b3 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/05-GettingStateFromEvents.Marten/05-GettingStateFromEvents.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj index 0c1fd7b9a..7bfbcba1f 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/06-GettingStateFromEvents.EventStoreDB/06-GettingStateFromEvents.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/07-BusinessLogic.csproj b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/07-BusinessLogic.csproj index d3bb9d329..c77497f65 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/07-BusinessLogic.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/07-BusinessLogic/07-BusinessLogic.csproj @@ -7,7 +7,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj index e5d0d1c42..a6c4f51a4 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/08-BusinessLogic.Marten/08-BusinessLogic.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj index a376099c7..044859b73 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/09-BusinessLogic.EventStoreDB/09-BusinessLogic.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj index ce5cfef6a..2ad48f9b3 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/10-OptimisticConcurrency.Marten/10-OptimisticConcurrency.Marten.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj index 90ad851bc..15ba1fcd4 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/11-OptimisticConcurrency.EventStoreDB/11-OptimisticConcurrency.EventStoreDB.csproj @@ -8,7 +8,7 @@ - + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/12-Projections.SingleStream/12-Projections.SingleStream.csproj b/Workshops/IntroductionToEventSourcing/Solved/12-Projections.SingleStream/12-Projections.SingleStream.csproj index 725cd5e1f..9cc38b3b3 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/12-Projections.SingleStream/12-Projections.SingleStream.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/12-Projections.SingleStream/12-Projections.SingleStream.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj b/Workshops/IntroductionToEventSourcing/Solved/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj index 725cd5e1f..9cc38b3b3 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/13-Projections.SingleStream.Idempotency/13-Projections.SingleStream.Idempotency.csproj @@ -7,8 +7,8 @@ - - + + all diff --git a/Workshops/IntroductionToEventSourcing/Solved/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj b/Workshops/IntroductionToEventSourcing/Solved/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj index 725cd5e1f..9cc38b3b3 100644 --- a/Workshops/IntroductionToEventSourcing/Solved/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj +++ b/Workshops/IntroductionToEventSourcing/Solved/14-Projections.SingleStream.EventualConsistency/14-Projections.SingleStream.EventualConsistency.csproj @@ -7,8 +7,8 @@ - - + + all