Skip to content

Commit

Permalink
refactor: perform an explicit SaveChanges in the backoffice projectio…
Browse files Browse the repository at this point in the history
…ns although it's redundant
  • Loading branch information
jvandaal authored and ArneD committed May 22, 2024
1 parent ee7ca00 commit 2d00018
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ParcelRegistry.Projections.BackOffice/BackOfficeProjections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ await backOfficeContext.AddIdempotentParcelAddressRelation(
new ParcelId(message.Message.ParcelId),
new AddressPersistentLocalId(addressPersistentLocalId),
cancellationToken);
await backOfficeContext.SaveChangesAsync(cancellationToken);
}
});

Expand All @@ -31,6 +33,8 @@ await backOfficeContext.AddIdempotentParcelAddressRelation(
new ParcelId(message.Message.ParcelId),
new AddressPersistentLocalId(message.Message.AddressPersistentLocalId),
cancellationToken);
await backOfficeContext.SaveChangesAsync(cancellationToken);
});

When<Envelope<ParcelAddressWasDetachedV2>>(async (_, message, cancellationToken) =>
Expand All @@ -40,6 +44,8 @@ await backOfficeContext.RemoveIdempotentParcelAddressRelation(
new ParcelId(message.Message.ParcelId),
new AddressPersistentLocalId(message.Message.AddressPersistentLocalId),
cancellationToken);
await backOfficeContext.SaveChangesAsync(cancellationToken);
});

When<Envelope<ParcelAddressWasDetachedBecauseAddressWasRejected>>(async (_, message, cancellationToken) =>
Expand All @@ -49,6 +55,8 @@ await backOfficeContext.RemoveIdempotentParcelAddressRelation(
new ParcelId(message.Message.ParcelId),
new AddressPersistentLocalId(message.Message.AddressPersistentLocalId),
cancellationToken);
await backOfficeContext.SaveChangesAsync(cancellationToken);
});

When<Envelope<ParcelAddressWasDetachedBecauseAddressWasRetired>>(async (_, message, cancellationToken) =>
Expand All @@ -58,6 +66,8 @@ await backOfficeContext.RemoveIdempotentParcelAddressRelation(
new ParcelId(message.Message.ParcelId),
new AddressPersistentLocalId(message.Message.AddressPersistentLocalId),
cancellationToken);
await backOfficeContext.SaveChangesAsync(cancellationToken);
});

When<Envelope<ParcelAddressWasDetachedBecauseAddressWasRemoved>>(async (_, message, cancellationToken) =>
Expand All @@ -67,6 +77,8 @@ await backOfficeContext.RemoveIdempotentParcelAddressRelation(
new ParcelId(message.Message.ParcelId),
new AddressPersistentLocalId(message.Message.AddressPersistentLocalId),
cancellationToken);
await backOfficeContext.SaveChangesAsync(cancellationToken);
});

When<Envelope<ParcelAddressWasReplacedBecauseAddressWasReaddressed>>(async (_, message, cancellationToken) =>
Expand Down

0 comments on commit 2d00018

Please sign in to comment.