private void GivingRulesFor(string propertyName, out ITagableRule minAttribute, out ITagableRule maxAttribute) { IClassValidator cv = new ClassValidator(typeof(Entity)); IEnumerable <Attribute> ma = cv.GetMemberConstraints(propertyName); minAttribute = (ITagableRule)ma.First(a => a.TypeId == minTypeId); maxAttribute = (ITagableRule)ma.First(a => a.TypeId == maxTypeId); }