Skip to content

Commit

Permalink
Fixed casting for guids
Browse files Browse the repository at this point in the history
  • Loading branch information
erdtsieck committed Feb 6, 2025
1 parent 687ec5f commit 7f92687
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Marten/Events/Aggregation/CustomProjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,12 @@ public IAggregateCache<TId, TDoc> CacheFor(Tenant tenant)

public TId IdentityFromEvent(IEvent e)
{
return e.StreamKey.To<TId>() ?? e.StreamId.To<TId>();
if (typeof(TId) == typeof(Guid))
{
return e.StreamId.To<TId>();
}

return e.StreamKey.To<TId>();
}
}

Expand Down

0 comments on commit 7f92687

Please sign in to comment.