protected override void OnBefore(IInvocation invocation) { var validator = (IValidator)Activator.CreateInstance(_validatorType); var entityType = _validatorType.BaseType.GetGenericArguments()[0]; var entities = invocation.Arguments.Where(t => t.GetType() == entityType); foreach (var entity in entities) { ValidationTool.validate(validator, entity); } }