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)); }
void IRpcModule.Configure(IRpcApi api) { api.ApplyFilter(ApplyFilter); Configure(api); if (AutoRegister) { AutoRegisterMethods(api); } }
protected override void ApiRegistration(IRpcApi api) { api.ApplyFilter <Filter>(); api.Expose <Service>(); }
protected override void ApiRegistration(IRpcApi api) { api.DefaultHttpMethod(ExposeDefaultMethod.PostOnly); api.ApplyFilter <Filter>(); api.Expose <Service>(); }