Skip to content

Conversation

@DavidBoike
Copy link
Member

No description provided.

public class OrderPolicy : Saga<OrderPolicyData>,
IAmStartedByMessages<OrderPlaced>,
IAmStartedByMessages<OrderBilled>,
IHandleTimeouts<OrderPlaced> // Should not also use a message as timeout state in real life!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

[Test]
public void SagaWithInappropriateDoubleMessageMapping()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the test name be "SagaThatIsResusingMessageAsTimeoutState"?


var handlerFullyQualifiedName = handlerType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
return new HandlerSpec(InterceptLocationSpec.From(location), handlerType.Name, handlerFullyQualifiedName, registrations);
var handlerTypeSpec = HandlerTypeSpec.From(handlerType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change

}

(string methodName, HandlerSpec handlerSpec) = first;
HandlerSpec first = group.First();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally went with avoiding LINQ for efficiency reasons. It seems, though, LINQ is smart enough in this case to see that the enumerable is an array and therefore always accesses the first element so I'm OK leaving it as is

@danielmarbach
Copy link
Contributor

I would wait with merging until we discussed #7560

@DavidBoike DavidBoike merged commit 28b1cdd into master Dec 15, 2025
4 checks passed
@DavidBoike DavidBoike deleted the mismatched-add-methods branch December 15, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants