当你看到这样的事情时,你会重构吗?还是你只是塞住鼻子继续前进?
public Collection<DataValidationRuleBase> GetFieldValidationRules(String key)
{
Collection<DataValidationRuleBase> found = null;
try
{
this.mRules.TryGetValue(key, out found);
}
catch (ArgumentException ex)
{
//log the error
Log.Error(ExceptionHandling.BuildExceptionMessage(ex));
return null;
}
return found;
}