Esempio n. 1
0
 public bool Validate(Item item)
 {
     return item.Fields.All(field => _validator.IsFieldValid(field.Value, field.Key));
 }
Esempio n. 2
0
 /// <summary>
 /// Checks whether or not a given item is valid.
 /// </summary>
 /// <param name="item">The item to validate.</param>
 /// <returns>true if the item is valid; false otherwise.</returns>
 public bool IsItemValid(Item item)
 {
     return _checkers.ContainsKey(item.Type) ? _checkers[item.Type].Validate(item) : _defaultChecker.Validate(item);
 }