/// <summary> /// The check statement. /// </summary> /// <param name="statement"> /// The statement. /// </param> /// <param name="level"> /// The level. /// </param> public void CheckStatement(Statement statement, CheckLevelEnum level) { LogicalControlException ex = null; foreach (var checkStatement in checkStatements.Where(x => x.Level == level)) { try { if (checkStatement.CheckRequired) { checkStatement.CheckObject(statement); } } catch (LogicalControlException exception) { if (ex == null) { ex = exception; } else { ex.AddException(exception); } } } if (ex != null) { throw ex; } }
/// <summary> /// Initializes a new instance of the <see cref="Check"/> class. /// </summary> /// <param name="level"> /// The level. /// </param> /// <param name="sessionFactory"> /// The session factory. /// </param> /// <param name="expression"> /// The expression. /// </param> protected Check( CheckLevelEnum level, ISessionFactory sessionFactory, Expression <Func <Statement, object> > expression) : this(level, sessionFactory) { Expression = expression; }
/// <summary> /// Initializes a new instance of the <see cref="Check"/> class. /// </summary> /// <param name="level"> /// The level. /// </param> /// <param name="sessionFactory"> /// The session factory. /// </param> protected Check(CheckLevelEnum level, ISessionFactory sessionFactory) { SessionFactory = sessionFactory; Level = level; }