예제 #1
0
 public static MethodModel FromHeader(this MethodModel model, string parameter, string name = null)
 {
     model.Parameter(parameter).FromHeader = name ?? parameter;
     return(model);
 }
예제 #2
0
 public static ParameterModel Parameter(this MethodModel model, string parameter)
 {
     return(model.Parameters.First(p => p.Name == parameter));
 }
예제 #3
0
 public static MethodModel FromBody(this MethodModel model, string parameter)
 {
     model.Parameter(parameter).FromBody = true;
     return(model);
 }
예제 #4
0
 public static MethodModel Route(this MethodModel model, string template)
 {
     template           = template ?? throw new ArgumentNullException(nameof(template));
     model.RoutePattern = template == null ? null : RoutePatternFactory.Parse(template);
     return(model);
 }