public override bool Validate(IWaterAnimal fish) { if (!IsNullOrWhiteSpace(fish.Name)) { return true; } else { throw new Exception("Name Can not be empty"); } }
public override bool Validate(IWaterAnimal fish) { if (fish.PortionFood >= 0) { return true; } else { throw new Exception("PortionFood can not be 0"); } }
public abstract bool Validate(IWaterAnimal fish);
public bool Validate(IWaterAnimal fish) { return _validators.All(v => v.Validate(fish)); }