From b1535d81ab38a77f19e80b4d3f49ff1d0c906426 Mon Sep 17 00:00:00 2001 From: Mattias Nordqvist Date: Mon, 21 May 2018 12:05:36 +0200 Subject: [PATCH] bug fixes --- ProductAssemblyInfo.cs | 8 ++++---- .../Default/ParameterCreatorTransformer.cs | 13 ++++++++++++- .../Transformers/Headers/AddHeaderAttribute.cs | 2 +- WebAnchor/WebAnchor.csproj | 3 ++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ProductAssemblyInfo.cs b/ProductAssemblyInfo.cs index 8200662..328db07 100644 --- a/ProductAssemblyInfo.cs +++ b/ProductAssemblyInfo.cs @@ -1,11 +1,11 @@ using System.Reflection; [assembly: AssemblyProduct("WebAnchor")] [assembly: AssemblyCompany("Spinit AB, Mattias Nordqvist, Carl Berg and contributors")] -[assembly: AssemblyCopyright("Copyright © Spinit AB, Mattias Nordqvist, Carl Berg and contributors 2015")] +[assembly: AssemblyCopyright("Copyright © Spinit AB, Mattias Nordqvist, Carl Berg and contributors 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] /* File versions are set by CI build */ -[assembly: AssemblyVersion("6.2.0")] -[assembly: AssemblyFileVersion("6.2.0")] -[assembly: AssemblyInformationalVersion("6.2.0")] \ No newline at end of file +[assembly: AssemblyVersion("6.2.1")] +[assembly: AssemblyFileVersion("6.2.1")] +[assembly: AssemblyInformationalVersion("6.2.1")] \ No newline at end of file diff --git a/WebAnchor/RequestFactory/Transformation/Transformers/Default/ParameterCreatorTransformer.cs b/WebAnchor/RequestFactory/Transformation/Transformers/Default/ParameterCreatorTransformer.cs index d385bd5..2b86b3b 100644 --- a/WebAnchor/RequestFactory/Transformation/Transformers/Default/ParameterCreatorTransformer.cs +++ b/WebAnchor/RequestFactory/Transformation/Transformers/Default/ParameterCreatorTransformer.cs @@ -11,12 +11,23 @@ public class ParameterCreatorTransformer : IParameterListTransformer { public IEnumerable Apply(IEnumerable parameters, RequestTransformContext requestTransformContext) { - return + foreach(Parameter p in parameters) + { + yield return p; + } + + var newParameters = requestTransformContext.ApiInvocation.Method.GetParameters() .Select((x, i) => new { ParameterInfo = x, ArgumentValue = requestTransformContext.ApiInvocation.GetArgumentValue(i) }) .Where(x => x.ArgumentValue != null) .Select(x => ResolveParameter(x.ParameterInfo, x.ArgumentValue, requestTransformContext)) .ToList(); + + foreach (Parameter p in newParameters) + { + yield return p; + } + } public virtual string CreateRouteSegmentId(string name) diff --git a/WebAnchor/RequestFactory/Transformation/Transformers/Headers/AddHeaderAttribute.cs b/WebAnchor/RequestFactory/Transformation/Transformers/Headers/AddHeaderAttribute.cs index 99ed487..8baeb84 100644 --- a/WebAnchor/RequestFactory/Transformation/Transformers/Headers/AddHeaderAttribute.cs +++ b/WebAnchor/RequestFactory/Transformation/Transformers/Headers/AddHeaderAttribute.cs @@ -6,7 +6,7 @@ namespace WebAnchor.RequestFactory.Transformation.Transformers.Headers { - [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method)] + [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method, AllowMultiple = true)] public class AddHeaderAttribute : ParameterListTransformerAttribute { public AddHeaderAttribute(string headerName, string value) diff --git a/WebAnchor/WebAnchor.csproj b/WebAnchor/WebAnchor.csproj index b3511a0..5e5c8da 100644 --- a/WebAnchor/WebAnchor.csproj +++ b/WebAnchor/WebAnchor.csproj @@ -16,7 +16,8 @@ https://github.com/mattiasnordqvist/Web-Anchor.git https://github.com/mattiasnordqvist/Web-Anchor/raw/master/logo.png REST HTTP API JSON - New multipart attribute + AddHeader-attribute is now "AllowMultiple" +ParameterCreatorTransformer does not clear list of parameters. true