protected override void ApiRegistration(IRpcApi api) { api.Expose <AttributedIntMathService>(); api.Method.Get("/noparams2", () => new GenericResult <int> { Result = 10 }); }
/// <summary> /// Expose types in the same assembly and namespace as T /// </summary> /// <typeparam name="T"></typeparam> /// <param name="configuration"></param> /// <param name="includeSubnamespaces"></param> /// <returns></returns> public static ITypeSetExposureConfiguration ExposeNamespaceContaining <T>(this IRpcApi configuration, bool includeSubnamespaces = true) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } return(configuration.Expose(typeof(T).GetTypeInfo().Assembly.ExportedTypes.Where(TypesThat.AreInTheSameNamespaceAs <T>(includeSubnamespaces)))); }
public static void DefaultConfigurationAction(IRpcApi api) { api.ExposeModules(); api.Expose(Assembly.GetEntryAssembly().ExportedTypes).OnlyAttributed(); }
protected override void ApiRegistration(IRpcApi api) { api.Environment.EnableCompression(); api.Expose <Service>(); }
protected override void ApiRegistration(IRpcApi api) { api.Expose <Service>(); }
protected override void ApiRegistration(IRpcApi api) { api.DefaultHttpMethod(ExposeDefaultMethod.PostOnly); api.Expose <Service>(); }
protected override void ApiRegistration(IRpcApi api) { api.ApplyFilter <Filter>(); api.Expose <Service>(); }
protected override void ApiRegistration(IRpcApi api) { api.ApplyFluentValidation(); api.Expose <Service>(); }
protected override void ApiRegistration(IRpcApi api) { api.Expose <IntMath>(); }
protected override void ApiRegistration(IRpcApi api) { api.Expose <AttributedIntMathService>(); api.Method.Get("/stringtest/{stringValue}", (string stringValue) => stringValue + " Hello World!"); }
/// <summary> /// Register public methods /// </summary> /// <param name="api"></param> protected virtual void AutoRegisterMethods(IRpcApi api) => api.Expose(GetType()).Activation(context => this);
protected override void ApiRegistration(IRpcApi api) { api.UseRequestExecutionContextFeature(); api.Expose <Service>(); }
protected override void ApiRegistration(IRpcApi api) { api.Expose(typeof(Service)).As("IntMath"); }