Пример #1
0
        /// <summary>
        /// Activate the validation mechanism, so every request DTO with an existing validator
        /// will be validated.
        /// </summary>
        /// <param name="appHost">The app host</param>
        public static void Init(IAppHost appHost)
        {
            Enabled = true;
            var filter = new ValidationFilters();

            appHost.RequestFilters.Add(filter.RequestFilter);
        }
 /// <summary>
 /// Activate the validation mechanism, so every request DTO with an existing validator
 /// will be validated.
 /// </summary>
 /// <param name="appHost">The app host</param>
 public void Register(IAppHost appHost)
 {
     if (Enabled) return;
     Enabled = true;
     var filter = new ValidationFilters();
     appHost.RequestFilters.Add(filter.RequestFilter);
 }
Пример #3
0
        /// <summary>
        /// Activate the validation mechanism, so every request DTO with an existing validator
        /// will be validated.
        /// </summary>
        /// <param name="appHost">The app host</param>
        public void Register(IAppHost appHost)
        {
            if (Enabled)
            {
                return;
            }
            Enabled = true;
            var filter = new ValidationFilters();

            appHost.RequestFilters.Add(filter.RequestFilter);
        }
Пример #4
0
        /// <summary>
        /// Activate the validation mechanism, so every request DTO with an existing validator
        /// will be validated.
        /// </summary>
        /// <param name="appHost">The app host</param>
        public void Register(IAppHost appHost)
        {
            Enabled = true;
            var filter = new ValidationFilters();

            this.appHost = appHost;
            appHost.RequestFilters.Add(filter.RequestFilter);

            existingHandler = appHost.ServiceExceptionHandler;
            appHost.ServiceExceptionHandler = HandleException;
        }
Пример #5
0
 /// <summary>
 /// Activate the validation mechanism, so every request DTO with an existing validator
 /// will be validated.
 /// </summary>
 /// <param name="appHost">The app host</param>
 public static void Init(IAppHost appHost)
 {
     Enabled = true;
     var filter = new ValidationFilters();
     appHost.RequestFilters.Add(filter.RequestFilter);
 }