/// <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); }
/// <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); }
/// <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; }