public ReferendumResult Confirm(ReferendumResult result, ResultInfo originatingInfo) { CommandInfo commandInfo = new CommandInfo { CommandGeneratedByUser = originatingInfo.CommandGeneratedByUser, OriginatingPollingCentre = originatingInfo.OriginatingPollingCentre, }; ConfirmReferendumResultsCommand confirmReferendumResultsCommand = new ConfirmReferendumResultsCommand { CommandId = Guid.NewGuid(), CommandGeneratedByUser = commandInfo.CommandGeneratedByUser, OriginatingPollingCentre = commandInfo.OriginatingPollingCentre, ApplyToResult = result.GetResultRef(), CommandExecutionOrder = result.LastResultCommandExecutedOrder + 1, }; result.Apply(confirmReferendumResultsCommand); return(result); }
public ReferendumResult Modify(ReferendumResult result, ResultInfo originatingInfo, List <ResultDetail> resultDetails) { CommandInfo commandInfo = new CommandInfo { CommandGeneratedByUser = originatingInfo.CommandGeneratedByUser, OriginatingPollingCentre = originatingInfo.OriginatingPollingCentre, }; var command = new ModifyReferendumResultsCommand { CommandId = Guid.NewGuid(), CommandGeneratedByUser = commandInfo.CommandGeneratedByUser, OriginatingPollingCentre = commandInfo.OriginatingPollingCentre, ApplyToResult = result.GetResultRef(), CommandExecutionOrder = result.LastResultCommandExecutedOrder + 1, ResultDetail = resultDetails, }; result.Apply(command); return(result); }