Arc.Infrastructure.Data.NHibernate.Listeners.BaseValidationListener.Validate C# (CSharp) Method

Validate() public method

Validates the specified entity.
public Validate ( object entity, Type type ) : void
entity object The entity.
type System.Type The type.
return void
        public void Validate(object entity, Type type)
        {
            var validatable = entity as IEntity;
            if (validatable == null)
                return;

            var results = _validation.Validate(entity, type);

            if (!results.IsValid)
                throw new ValidationException(results);
        }