protected override void ApiRegistration(IRpcApi api)
        {
            var filter = new FinalizeFilterTest.FinalizeFilter(() => _finalizedCalled = true);

            api.ApplyFilter(method => context => filter);
            api.Method.Get("/test", () => new { result = 123 });
        }
        /// <summary>
        /// Apply filter that locates validator for models
        /// </summary>
        /// <param name="configuration"></param>
        /// <returns></returns>
        public static IRpcApi ApplyFluentValidation(this IRpcApi configuration)
        {
            var filterProvider = new ValidationFilterProvider(
                configuration.AppServices.GetRequiredService <IErrorWrappingService>());

            return(configuration.ApplyFilter(filterProvider.GetFilters));
        }
Example #3
0
        void IRpcModule.Configure(IRpcApi api)
        {
            api.ApplyFilter(ApplyFilter);

            Configure(api);

            if (AutoRegister)
            {
                AutoRegisterMethods(api);
            }
        }
Example #4
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.ApplyFilter <Filter>();
     api.Expose <Service>();
 }
Example #5
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.DefaultHttpMethod(ExposeDefaultMethod.PostOnly);
     api.ApplyFilter <Filter>();
     api.Expose <Service>();
 }