When we correlate messages that participate in sagas against their data, we use an Expression as the second parameter. Like this example from the wiki:
protected override void CorrelateMessages(ICorrelationConfig<CollectLegalInfoSagaData> config)
{
config.Correlate<CustomerCreated>(m => m.CustomerId, d => d.CrmCustomerId);
config.Correlate<LegalInfoAcquiredInFirstSystem>(m => m.CorrId, d => d.CrmCustomerId);
config.Correlate<LegalInfoAcquiredInSecondSystem>(m => m.CorrId, d => d.CrmCustomerId);
}
I think this parameter is only used to identify the name of the property in the SagaData.
Would it be sensible to have an overload for the second parameter that allowed us to pass a string? For example:
When we correlate messages that participate in sagas against their data, we use an Expression as the second parameter. Like this example from the wiki:
I think this parameter is only used to identify the name of the property in the SagaData.
Would it be sensible to have an overload for the second parameter that allowed us to pass a string? For example:
My motivation is to make it easier to use a saga from another language, F# in this case.
I think this would also apply to the other methods in ICorrelationConfig.cs also.