Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task DisposeAsync()
public void Ctor_Should_Throw_Argument_Null_Exception_When_Inner_Connection_Lifetime_Is_Null()
{
_innerConnectionLifetime = null;
var act = () => new EventTracingConnectionLifetime(_innerConnectionLifetime, DefaultTenant, new());
EventTracingConnectionLifetime act() => new EventTracingConnectionLifetime(_innerConnectionLifetime, DefaultTenant, new());
Should.Throw<ArgumentNullException>(act);
}

Expand All @@ -80,7 +80,7 @@ public void Ctor_Should_Throw_Argument_Null_Exception_When_Inner_Connection_Life
[InlineData(null)]
public void Ctor_Should_Throw_Argument_Exception_When_Tenant_Id_Is_Null(string tenantId)
{
var act = () => new EventTracingConnectionLifetime(_innerConnectionLifetime, tenantId, new());
EventTracingConnectionLifetime act() => new EventTracingConnectionLifetime(_innerConnectionLifetime, tenantId, new());
Should.Throw<ArgumentException>(act);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading.Tasks;
using JasperFx.Events;
Expand Down Expand Up @@ -28,15 +28,15 @@ public async Task throw_transformed_exception_with_details_redacted()
theSession.Events.Append(streamId, departed);
await theSession.SaveChangesAsync();

var forceEventStreamUnexpectedMaxEventIdException = async () =>
async Task forceEventStreamUnexpectedMaxEventIdException()
{
await Parallel.ForEachAsync(Enumerable.Range(1, 10), async (_, token) =>
{
await using var session = theStore.LightweightSession();
session.Events.Append(streamId, departed);
await session.SaveChangesAsync(token);
});
};
}

(await Should.ThrowAsync<EventStreamUnexpectedMaxEventIdException>(forceEventStreamUnexpectedMaxEventIdException))
.Message.ShouldContain("pk_mt_events_stream_and_version");
Expand Down
8 changes: 4 additions & 4 deletions src/Marten/Internal/TenantDataCleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ await _store.Options.TenantPartitions.Partitions.DropPartitionFromAllTablesForVa
}

bool foundTables = false;
Action<DbObjectName> deleteTenantedDataIfExists = tableName =>
void deleteTenantedDataIfExists(DbObjectName tableName)
{
if (tables.Contains(tableName))
{
Expand All @@ -60,9 +60,9 @@ await _store.Options.TenantPartitions.Partitions.DropPartitionFromAllTablesForVa
builder.Append($"delete from {tableName.QualifiedName} where tenant_id = ");
builder.AppendParameter(_tenantId);
}
};
}

Action<DbObjectName> deleteDataIfExists = tableName =>
void deleteDataIfExists(DbObjectName tableName)
{
if (tables.Contains(tableName))
{
Expand All @@ -71,7 +71,7 @@ await _store.Options.TenantPartitions.Partitions.DropPartitionFromAllTablesForVa
builder.StartNewCommand();
builder.Append($"delete from {tableName.QualifiedName}");
}
};
}

if (_store.Options.Events.TenancyStyle == TenancyStyle.Conjoined)
{
Expand Down
Loading