public static MethodModel FromHeader(this MethodModel model, string parameter, string name = null) { model.Parameter(parameter).FromHeader = name ?? parameter; return(model); }
public static ParameterModel Parameter(this MethodModel model, string parameter) { return(model.Parameters.First(p => p.Name == parameter)); }
public static MethodModel FromBody(this MethodModel model, string parameter) { model.Parameter(parameter).FromBody = true; return(model); }
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); }