You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upon completion of command execution, an instance of ExecutionResult is returned, which contains a success status, an errors list, and object state (optionally). Based on the successful validation of rules, the success status of execution result will be true, potentially containing object state from the result of the command operation. When the validation of rules fail, the success status of execution result will be false, and the errors list will be populated.
Below are a couple of test code samples that show how an ExecutionResult can be consumed:
An example of a command that has been configured with a rule that succeeds during validation.
An example of a command that has been configured with a rule that fails during validation.
varexecutionResult=awaitcreateCustomerCommand.ExecuteAsync();executionResult.Success.ShouldBeFalse();executionResult.Errors.Count().ShouldBe(1);executionResult.Errors.First().ErrorMessage.ShouldBe("Last name is required");executionResult.Value.ShouldBeNull();