コード例 #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
ファイル: ValidationFeature.cs プロジェクト: vdt/ServiceStack
        /// <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);
 }