Created
October 15, 2019 01:07
-
-
Save MarcoNicolodi/390da16047f3ab51a229a0ebcdd888ea to your computer and use it in GitHub Desktop.
Proposal using double dispatch to call domain service within a single operation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Proposal : Aggregate | |
{ | |
public void Accept(IDomainService domainService) | |
{ | |
ChangeStatus(ProposalStatus.Accepted); | |
base.EventsRaised.Add(new ProposalAcceptedEvent(proposal.Id, proposal.AcceptedAt)) | |
domainService.DenyOtherCompaniesProposals(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment