//public bool Matches(TEntity entity) public bool Matches(IConventionParams <TEntity> conventionParams) { Guard.AssertNotNull(_matcher, "Не определен объект сравнения в конвенции"); //return _matcher(entity); return(_matcher(conventionParams)); }
//public bool Matches(TEntity entity) public bool Matches(IConventionParams <TEntity> conventionParams) { Guard.Against <ArgumentNullException>(_convension == null, "Ошибка проверки в комплексном соглашении политики: соглашение не задано"); bool ret = !_convension.Matches(conventionParams); return(ret); }
//public bool Matches(TEntity entity) public bool Matches(IConventionParams <TEntity> conventionParams) { if (_evaluator(conventionParams)) { return(_propConvention.Matches(_getter(conventionParams))); } else { return(false); } }
//public bool Matches(TEntity entity) public bool Matches(IConventionParams <TEntity> conventionParams) { Guard.Against <ArgumentNullException>(_left == null, "Ошибка проверки в комплексном соглашении политики: _left - соглашение не задано"); Guard.Against <ArgumentNullException>(_right == null, "Ошибка проверки в комплексном соглашении политики: _right - соглашение не задано"); bool ret = false; switch (_composeType) { case ComposeType.And: //ret = _left.Matches(entity) && _right.Matches(entity); ret = _left.Matches(conventionParams) && _right.Matches(conventionParams); break; case ComposeType.Or: //ret = _left.Matches(entity) || _right.Matches(entity); ret = _left.Matches(conventionParams) || _right.Matches(conventionParams); break; } return(ret); }
//public bool Matches(TEntity entity) public bool Matches(IConventionParams <TEntity> conventionParams) { return(_propConvention.Matches(_getter(conventionParams))); }
//public bool Matches(TEntity entity) public bool Matches(IConventionParams <TEntity> conventionParams) { Guard.Against <ArgumentException>(_conventions.IsNullOrEmpty(), "Ошибка определения политики: не определена коллекция соглашений"); return(_conventions.Any(c => c.Matches(conventionParams))); }