示例#1
0
 public UserException(List <string> userErrors, int code = 400) : this(code)
 {
     if (userErrors != null && userErrors.Count != 0)
     {
         UserErrors.AddRange(userErrors);
     }
 }
示例#2
0
 public UserException(string[] userErrors, int code = 400) : this(code)
 {
     if (userErrors != null && userErrors.Length != 0)
     {
         UserErrors.AddRange(userErrors);
     }
 }
示例#3
0
 public UserException(ModelStateDictionary modelState, int code = 400) : this(code)
 {
     UserErrors.AddRange(modelState
                         .Select(x => x.Value.Errors)
                         .Where(y => y.Count > 0)
                         .SelectMany(z => z)
                         .Select(e => e.ErrorMessage));
 }
示例#4
0
 public UserException(IdentityResult result, int code = 400) : this(code)
 {
     UserErrors.AddRange(result.Errors.Select(x => x.Description));
 }