示例#1
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.Expose <AttributedIntMathService>();
     api.Method.Get("/noparams2", () =>
                    new GenericResult <int> {
         Result = 10
     });
 }
示例#2
0
        /// <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))));
        }
示例#3
0
        public static void DefaultConfigurationAction(IRpcApi api)
        {
            api.ExposeModules();

            api.Expose(Assembly.GetEntryAssembly().ExportedTypes).OnlyAttributed();
        }
示例#4
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.Environment.EnableCompression();
     api.Expose <Service>();
 }
示例#5
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.Expose <Service>();
 }
 protected override void ApiRegistration(IRpcApi api)
 {
     api.DefaultHttpMethod(ExposeDefaultMethod.PostOnly);
     api.Expose <Service>();
 }
示例#7
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.ApplyFilter <Filter>();
     api.Expose <Service>();
 }
示例#8
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.ApplyFluentValidation();
     api.Expose <Service>();
 }
示例#9
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.Expose <IntMath>();
 }
示例#10
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.Expose <AttributedIntMathService>();
     api.Method.Get("/stringtest/{stringValue}", (string stringValue) => stringValue + " Hello World!");
 }
示例#11
0
 /// <summary>
 /// Register public methods
 /// </summary>
 /// <param name="api"></param>
 protected virtual void AutoRegisterMethods(IRpcApi api) => api.Expose(GetType()).Activation(context => this);
示例#12
0
        protected override void ApiRegistration(IRpcApi api)
        {
            api.UseRequestExecutionContextFeature();

            api.Expose <Service>();
        }
示例#13
0
 protected override void ApiRegistration(IRpcApi api)
 {
     api.Expose(typeof(Service)).As("IntMath");
 }