Skip to content

Commit 74d6e59

Browse files
committed
Fixed breaking changes in Marten v8 bump
1 parent bbd8bec commit 74d6e59

25 files changed

Lines changed: 69 additions & 33 deletions

File tree

Core.Marten/Ids/MartenIdGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ public class MartenIdGenerator(IDocumentSession documentSession): IIdGenerator
88
{
99
private readonly IDocumentSession documentSession = documentSession ?? throw new ArgumentNullException(nameof(documentSession));
1010

11-
public Guid New() => CombGuidIdGeneration.NewGuid();
11+
public Guid New() => Marten.Schema.Identity.CombGuid.NewGuid();
1212
}

Core.Marten/MartenConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Core.Marten.Ids;
55
using Core.Marten.Subscriptions;
66
using Marten;
7-
using Marten.Events.Daemon.Resiliency;
7+
using Marten.Events.Daemon;
88
using Marten.Services;
99
using Microsoft.Extensions.Configuration;
1010
using Microsoft.Extensions.DependencyInjection;

Core.Marten/Subscriptions/MartenEventPublisher.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Marten;
44
using Marten.Events.Daemon;
55
using Marten.Events.Daemon.Internals;
6+
using Marten.Storage;
67
using Marten.Subscriptions;
78
using Microsoft.Extensions.DependencyInjection;
89
using Microsoft.Extensions.Logging;

Marten.Integration.Tests/EventStore/Projections/AggregationProjectionsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void Apply(IssueUpdated @event)
6161
}
6262
}
6363

64-
public class IssueDescriptionsProjection: SingleStreamProjection<IssueDescriptions>
64+
public class IssueDescriptionsProjection: SingleStreamProjection<IssueDescriptions, string>
6565
{
6666
public void Apply(IssueCreated @event, IssueDescriptions item)
6767
{

Marten.Integration.Tests/EventStore/Projections/DocumentChangesForwarding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public record ProjectInfo(
3232
Guid? ManagerId = null
3333
);
3434

35-
public class ProjectInfoProjection: SingleStreamProjection<ProjectInfo>
35+
public class ProjectInfoProjection: SingleStreamProjection<ProjectInfo, string>
3636
{
3737
public static ProjectInfo Create(ProjectCreated created) =>
3838
new(created.ProjectId, created.Name);

Marten.Integration.Tests/EventStore/UniqueConstraint/UniqueContstraintTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public record UserNameGuard(
2828
string Email
2929
);
3030

31-
public class UserNameGuardProjection: SingleStreamProjection<UserNameGuard>
31+
public class UserNameGuardProjection: SingleStreamProjection<UserNameGuard, string>
3232
{
3333
public UserNameGuardProjection() =>
3434
DeleteEvent<UserDeleted>();

Sample/ClosingTheBooks/PointOfSales.Api/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
// Added as inline for now to make tests easier, should be async in the end
5757
options.Projections.Add<CashierShiftTrackerProjection>(ProjectionLifecycle.Inline);
5858
})
59-
.OptimizeArtifactWorkflow(TypeLoadMode.Static)
6059
.UseLightweightSessions()
6160
.AddAsyncDaemon(DaemonMode.Solo);
6261

@@ -65,7 +64,14 @@
6564
.Configure<Microsoft.AspNetCore.Mvc.JsonOptions>(o =>
6665
o.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()));
6766

68-
builder.Host.ApplyOaktonExtensions();
67+
// Configure production vs development settings
68+
builder.Services.CritterStackDefaults(x =>
69+
{
70+
x.Production.GeneratedCodeMode = TypeLoadMode.Static;
71+
x.Production.ResourceAutoCreate = AutoCreate.None;
72+
});
73+
74+
builder.Host.ApplyJasperFxExtensions();
6975

7076
var app = builder.Build();
7177

Sample/ClosingTheBooks/PointOfSales/CashierShifts/CurrentCashierShift.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public record ClosingDetails(
2626
DateTimeOffset? ClosedAt = null
2727
);
2828

29-
public class CurrentCashierShiftProjection: SingleStreamProjection<CurrentCashierShift>
29+
public class CurrentCashierShiftProjection: SingleStreamProjection<CurrentCashierShift, string>
3030
{
3131
public static CurrentCashierShift Create(ShiftOpened @event) =>
3232
new(

Sample/ECommerce/Carts/Carts/ShoppingCarts/GettingCartById/ShoppingCartDetails.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void Apply(ShoppingCartCanceled @event) =>
8080
.SingleOrDefault(pi => pi.MatchesProductAndPrice(productItem));
8181
}
8282

83-
public class CartDetailsProjection : SingleStreamProjection<ShoppingCartDetails>
83+
public class CartDetailsProjection : SingleStreamProjection<ShoppingCartDetails, string>
8484
{
8585
public CartDetailsProjection()
8686
{

Sample/ECommerce/Carts/Carts/ShoppingCarts/GettingCarts/ShoppingCartShortInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void Apply(ShoppingCartCanceled @event)
4343
}
4444
}
4545

46-
public class CartShortInfoProjection : SingleStreamProjection<ShoppingCartShortInfo>
46+
public class CartShortInfoProjection : SingleStreamProjection<ShoppingCartShortInfo, string>
4747
{
4848
public CartShortInfoProjection()
4949
{

0 commit comments

Comments
 (0)