コード例 #1
0
 /// <summary>
 /// Add an API handler using uri template.
 /// </summary>
 /// <param name="uriTemplate">The relative uri template of the API.</param>
 /// <param name="statusCode">The HTTP status code of the response.</param>
 /// <param name="name">
 /// The name of the handler. If there is no tracing requirement, leave this value as <c>null</c>. The default
 /// value of this parameter is <c>null</c>.
 /// </param>
 /// <returns>The <see cref="WithServiceClause"/> instance.</returns>
 public WithServiceClause Api(
     string uriTemplate,
     HttpStatusCode statusCode,
     string name = null)
 {
     return(Api(uriTemplate, (string[])null, _ => statusCode.AsResponse(), name));
 }
コード例 #2
0
 /// <summary>
 /// Add a default handler. If no other handler can handle the request, the default handler will do it.
 /// </summary>
 /// <param name="statusCode">The status code that will be returned by default handler.</param>
 /// <param name="name">
 /// The name of the handler. If there is no tracing requirement, leave this value as <c>null</c>. The default
 /// value of this parameter is <c>null</c>.
 /// </param>
 /// <returns>The <see cref="WithServiceClause"/> instance.</returns>
 public WithServiceClause Default(HttpStatusCode statusCode, string name = null)
 {
     return(Default(req => statusCode.AsResponse(), name));
 }