private void UpgradeSync(string name, string path, Func <dynamic, object> value) { switch (_httpMethod) { case HttpMethod.Get: _module.Get(path, value, null, name); break; case HttpMethod.Put: _module.Put(path, value, null, name); break; case HttpMethod.Post: _module.Post(path, value, null, name); break; case HttpMethod.Delete: _module.Delete(path, value, null, name); break; case HttpMethod.Head: _module.Head(path, value, null, name); break; case HttpMethod.Patch: _module.Patch(path, value, null, name); break; case HttpMethod.Options: _module.Options(path, value, null, name); break; } }
public static void Get <TIn, TOut>(this NancyModule module, string name, string path, Func <TIn, TOut> handler) => module.Get(path, _ => RunHandler(module, handler), name: name);
public static void Get <TIn>(this NancyModule module, string name, string path, Func <TIn, Task <object> > handler) => module.Get(path, _ => RunHandlerAsync(module, handler), name: name);
public static void Get <TIn, TOut>(this NancyModule module, string path, Func <TIn, TOut> handler) => module.Get(path, path, handler);