Skip to content

Commit fe1f82c

Browse files
committed
change get snapshot types method
1 parent b284087 commit fe1f82c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/Core/src/Eventuous.Shared/SnapshotMap/SnapshotTypeMap.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,7 @@ public static void Register(Type stateType, Type eventType) {
1515
}
1616
}
1717

18-
public static HashSet<Type> GetSnapshotTypes<TState>() {
19-
var stateType = typeof(TState);
20-
21-
if (StateToSnapshots.TryGetValue(stateType, out var value)) {
22-
return value;
23-
}
24-
else {
25-
throw new InvalidOperationException();
26-
}
27-
}
18+
public static HashSet<Type> GetSnapshotTypes<TState>() => StateToSnapshots.GetValueOrDefault(typeof(TState), []);
2819
}
2920

3021
[AttributeUsage(AttributeTargets.Class)]

0 commit comments

Comments
 (0)