I am not entirely sure whether this should be a bug report or rather a feature request. If i recall correctly, the docs talk about strong id types as saga identities in the Marten section only, which could imply that this feature is not supported for EF Core + Postgres, yet. However, one could argue that there should be support due to the fact that with one of the recent updates, the framework is not throwing an exception anymore when using a non-primitive saga identity type. Correct me if i'm wrong.
Bug Description
When using a saga with a strong id type along with EF Core + Postgres persistence, it causes a compilation error during source generation:
System.AggregateException : One or more errors occurred. (Compilation failures!
CS0103: The name 'MessageId' does not exist in the current context
CS0246: The type or namespace name 'MessageId' could not be found (are you missing a using directive or an assembly reference?)
The full exception with the generated code is here
As you can see the generated code uses the bare type name MessageId rather than the fully qualified name containing its namespace. I believe this is due to PullSagaIdFromEnvelopeFrame using SagaId.VariableType.NameInCode() rather than FullNameInCode() here?
|
var typeNameInCode = SagaId.VariableType == typeof(Guid) |
|
? typeof(Guid).FullName |
|
: SagaId.VariableType.NameInCode(); |
|
|
|
writer.Write( |
|
$"if (!{typeNameInCode}.TryParse({_envelope!.Usage}.{nameof(Envelope.SagaId)}, out {typeNameInCode} sagaId)) throw new {typeof(IndeterminateSagaStateIdException).FullName}({_envelope.Usage});"); |
I am not entirely sure whether this should be a bug report or rather a feature request. If i recall correctly, the docs talk about strong id types as saga identities in the Marten section only, which could imply that this feature is not supported for EF Core + Postgres, yet. However, one could argue that there should be support due to the fact that with one of the recent updates, the framework is not throwing an exception anymore when using a non-primitive saga identity type. Correct me if i'm wrong.
Bug Description
When using a saga with a strong id type along with EF Core + Postgres persistence, it causes a compilation error during source generation:
The full exception with the generated code is here
As you can see the generated code uses the bare type name
MessageIdrather than the fully qualified name containing its namespace. I believe this is due toPullSagaIdFromEnvelopeFrameusingSagaId.VariableType.NameInCode()rather thanFullNameInCode()here?wolverine/src/Wolverine/Persistence/Sagas/PullSagaIdFromEnvelopeFrame.cs
Lines 29 to 34 in 49bed9d