public IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { foreach (var parameter in parameters) { Apply(parameter); } return parameters; }
public override IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { var list = parameters.ToList(); var content = list.First(x => x.ParameterType == ParameterType.Content); list.Add(new Parameter(null, content.ParameterValue.GetType().Name.ToLower(), ParameterType.Route) { Name = "type" }); return list; }
public IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { Context = parameterTransformContext; var url = Context.MethodInfo.GetCustomAttribute<HttpAttribute>().URL; return Context.MethodInfo.GetParameters() .Select((x, i) => new { Index = i, ParameterInfo = x }) .Where(x => Context.ApiInvocation.GetArgumentValue(x.Index) != null) .Select(x => new Parameter(x.ParameterInfo, Context.ApiInvocation.GetArgumentValue(x.Index), ResolveParameterType(x.ParameterInfo, url))) .ToList(); }
public override IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { foreach (var parameter in parameters) { if (parameter.ParameterType == ParameterType.Content) { ((Dictionary<string, object>)parameter.Value)["Name"] = "Mighty Gazelle"; } } return parameters; }
public IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { var param = parameters.Single(x => x.ParameterType == ParameterType.Content); var widget = (WidgetData)param.ParameterValue; var value = widget.WidgetKey; var list = parameters.ToList(); list.Add(new Parameter(null, value, ParameterType.Route) { Name = "widget-key", Value = value }); param.Value = new { Data = widget.Data }.ToDictionary(); return list; }
public override IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { var list = parameters.ToList(); if (parameterTransformContext.MethodInfo.DeclaringType.GetGenericArguments().Any()) { var value = parameterTransformContext.MethodInfo.DeclaringType.GetGenericArguments().First().Name.ToLower(); list.Add(new Parameter(null, value, ParameterType.Route) { Name = "type" }); } return list; }
public override IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { var parameterList = parameters.ToList(); parameterList.Add(new Parameter(null, _value, ParameterType.Query) { Name = _name, Value = _value }); return parameterList; }
public override IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { _testAction(parameters, parameterTransformContext); return parameters; }
public abstract IEnumerable <Parameter> TransformParameters(IEnumerable <Parameter> parameters, ParameterTransformContext parameterTransformContext);
public override IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { return parameters.Reverse(); }
public IEnumerable<Parameter> TransformParameters(IEnumerable<Parameter> parameters, ParameterTransformContext parameterTransformContext) { Resolve(parameters.Single(x => x.ParameterType == ParameterType.Content)); return parameters; }