public async Task SaveItemAsync(TItem item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } await _next.SaveItemAsync(item); }
public async Task SaveItemAsync(TItem item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } if (!_validator.Validate(item, out var errorDictionary)) { throw new BadRequestHttpException(errorDictionary); } await _next.SaveItemAsync(item); }