public void AddError(ErrorKey key, params object[] values)
 {
     Errors.Add(new KeyValuePair <ErrorKey, object[]>(key, values));
 }
 /// <summary>
 /// Add commerce error to model state
 /// </summary>
 /// <param name="modelState"></param>
 /// <param name="error"></param>
 /// <returns></returns>
 public static ModelStateDictionary AddCommerceError(this ModelStateDictionary modelState, ErrorKey error)
 {
     Arg.NotNull(modelState, nameof(ModelStateDictionary));
     Arg.NotNull <ErrorKey>(error, nameof(ErrorKey));
     modelState.AddModelError(error.Key, error.Value);
     return(modelState);
 }
Exemple #3
0
 set => Put(ErrorKey, value);
 protected virtual void OnErrorKey(ErrorKeysEventArgs e)
 {
     ErrorKey?.Invoke(this, e);
 }