You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where ExtCompKey is a struct: public record struct ExtCompKey(string Identifier, int Key);
now when I try to Map it in the flat table projection:
Project<MyEvent>(m =>{m.Map(x =>x.ItemId.Key);});
the code generation throws
System.InvalidOperationException: Compilation failures!
CS0023: Operator '?' cannot be applied to operand of type 'ExtCompKey'
...
case Marten.Events.IEvent<(redacted).MyEvent> event_MyEvent112:
operations.QueueSqlCommand("select public.mt_upsert_test1_myevent(?, ?);", event_MyEvent112.StreamId,
event_MyEvent112.Data.ItemId?.Key);
break;
the only workaround I found so far is to enrich the event with a direct accessor (public int ItmKey => ItemId.Key;) and use it in the Map expression
The text was updated successfully, but these errors were encountered:
migajek
changed the title
Map on a nested event property generates null-conditional member access resulting in compilation error
FlatTable's.Map on a nested event property generates null-conditional member access resulting in compilation error
Jan 26, 2025
Please consider the following event:
where
ExtCompKey
is astruct
:public record struct ExtCompKey(string Identifier, int Key);
now when I try to
Map
it in the flat table projection:the code generation throws
the only workaround I found so far is to enrich the event with a direct accessor (
public int ItmKey => ItemId.Key;
) and use it in theMap
expressionThe text was updated successfully, but these errors were encountered: