Beispiel #1
0
 protected void AddErrors(ShopOperationResult result)
 {
     foreach (var error in result.Errors)
     {
         ModelState.AddModelError(string.Empty, error.Description);
     }
 }
        public static ShopOperationResult Failed(params ShopError[] errors)
        {
            var result = new ShopOperationResult {
                Succeeded = false
            };

            if (errors != null)
            {
                result._errors.AddRange(errors);
            }
            return(result);
        }