Beispiel #1
0
 public CommonResult(Guid messageId, Outcome outcome, string flashMessage, ResultErrorCollection errors)
 {
     MessageId    = messageId;
     _outcome     = outcome;
     FlashMessage = flashMessage;
     Errors       = errors;
     TotalResults = errors.Count;
     Data         = default(string);
 }
Beispiel #2
0
 public CommonResult(Guid messageId, Outcome outcome, string flashMessage, int totalResults, ResultErrorCollection errors, dynamic data)
 {
     MessageId    = messageId;
     _outcome     = outcome;
     FlashMessage = flashMessage;
     TotalResults = totalResults;
     Errors       = errors;
     Data         = data;
 }
        public static CommonResult CommonResultFromDomainErrorList(this DomainErrorList domainErrorList,
                                                                   IRequest <CommonResult> request, ILogger logger)
        {
            ResultErrorCollection errorList = new ResultErrorCollection();

            foreach (string error in domainErrorList)
            {
                errorList.Add("", error);
            }

            return
                (new CommonResult(
                     messageId: ((IMessage)request).MessageId,
                     outcome: Outcome.DomainValidationFailure,
                     flashMessage: "A domain validation error occured handling request " + request.GetType() +
                     ", CorrelationID: " + CorrelationId,
                     errors: errorList));
        }