123 references to StringValues
HeaderPropagationSample (1)
Startup.cs (1)
124return new StringValues(values.ToArray());
HttpStress (2)
Program.cs (2)
443new StringValues(Enumerable.Range(0, i).Select(id => "value" + id).ToArray())); 452new StringValues(Enumerable.Range(0, i).Select(id => "value" + id).ToArray()));
InMemory.FunctionalTests (3)
Http2\Http2ConnectionTests.cs (1)
2449Headers[nameString] = new StringValues(l.ToArray());
Http2\Http2TestBase.cs (1)
985.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
715.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
451ctx.Response.Headers["MultiHeader"] = new StringValues(new string[] { "1", "2" });
Microsoft.AspNetCore.Authentication.Cookies (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
291responseHeaders.SetCookie = new StringValues(newValues.ToArray());
Microsoft.AspNetCore.Components.Endpoints (1)
Builder\ResourceCollectionUrlEndpoint.cs (1)
216context.Response.Headers.ETag = new StringValues(_gzipContentETags);
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Binding\FormDataMapperTests.cs (5)
322var data = new Dictionary<string, StringValues>() { ["values"] = new StringValues(new[] { "10", "11" }) }; 340var data = new Dictionary<string, StringValues>() { ["values"] = new StringValues(new[] { "Red", "Blue" }) }; 358var data = new Dictionary<string, StringValues>() { ["values"] = new StringValues(new[] { "Red", "Blue" }) }; 376var data = new Dictionary<string, StringValues>() { ["values"] = new StringValues(new[] { "10", "a" }) }; 401var data = new Dictionary<string, StringValues>() { ["values"] = new StringValues(new[] { "10", "a", "11" }) };
Microsoft.AspNetCore.CookiePolicy.Test (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
291responseHeaders.SetCookie = new StringValues(newValues.ToArray());
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
UnaryServerCallHandlerTests.cs (2)
1494["sub.subfields"] = new StringValues(new[] { "TestSubfields1!", "TestSubfields2!" }) 1795["field_mask_value.paths"] = new StringValues(fieldmask.Paths.ToArray()),
Microsoft.AspNetCore.HeaderParsing.Tests (13)
ParserTests.cs (13)
30var sv = new StringValues(new[] { "Hello", "World" }); 69var sv = new StringValues(new[] { "Hello", "World" }); 138var sv = new StringValues(new[] { "Hello", "World" }); 157var sv = new StringValues(new[] { "attachment; filename=\"cool.html\"", "attachment; filename=\"cool.html\"" }); 185var sv = new StringValues(new[] { "text/html; charset=UTF-8", "text/html; charset=UTF-8" }); 283var sv = new StringValues(new[] { "http://foo.com", "http://bar.com" }); 313var sv = new StringValues(new[] { "bytes=200-1000", "bytes=3000-4000" }); 351var sv = new StringValues(new[] { "\"67ab43\"", "\"67ab43\"" }); 369var sv = new StringValues(new[] { " 1.1.1.1 , 192.168.1.100 ", " 3.3.3.3 " }); 379var sv = new StringValues(new[] { "1.1.1.1,192.168.1.100", "3.3.3.3" }); 391var sv = new StringValues(new[] { testValue }); 403var sv = new StringValues(new[] { testValue }); 416var sv = new StringValues(values);
Microsoft.AspNetCore.Http (2)
Features\QueryFeature.cs (1)
210_accumulator[entry.Key] = new StringValues(entry.Value.ToArray());
Internal\ResponseCookies.cs (1)
160Headers.SetCookie = new StringValues(newValues.ToArray());
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (2)
GetHeaderSplitBenchmark.cs (2)
20{ "doubleValue", new StringValues(new [] { "first", "second" }) }, 21{ "manyValue", new StringValues(new [] { "first", "second", "third", "fourth", "fifth", "sixth" }) }
Microsoft.AspNetCore.Http.Extensions (2)
HeaderDictionaryTypeExtensions.cs (2)
85headers[name] = new StringValues(newValues); 115Headers.Append(name, new StringValues(newValues));
Microsoft.AspNetCore.Http.Extensions.Tests (20)
QueryBuilderTests.cs (1)
76new KeyValuePair<string, StringValues>("key1", new StringValues(new [] { "value1", string.Empty, "value3" })),
RequestDelegateFactoryTests.cs (7)
311new object[] { (Action<HttpContext, StringValues>)Store, new[] { "1", "2", "3" }, new StringValues(new[] { "1", "2", "3" }) }, 630["a"] = new(new[] { "1", "2", "3" }) 633httpContext.Request.Headers["Custom"] = new(new[] { "4", "5", "6" }); 637["form"] = new(new[] { "7", "8", "9" }) 654Assert.Equal(new StringValues(new[] { "1", "2", "3" }), httpContext.Items["query"]); 655Assert.Equal(new StringValues(new[] { "4", "5", "6" }), httpContext.Items["headers"]); 656Assert.Equal(new StringValues(new[] { "7", "8", "9" }), httpContext.Items["form"]!);
RequestDelegateGenerator\RequestDelegateCreationTests.Arrays.cs (8)
57httpContext.Request.Headers.Add("p", new StringValues(new string[] { "1", "1" })); 78httpContext.Request.Headers.Add("p", new StringValues(new string[] { "1", "1" })); 99httpContext.Request.Headers.Add("p", new StringValues(new string[] { "1", "1" })); 117new object[] { "StringValues", new[] { "1", "2", "3" }, new StringValues(new[] { "1", "2", "3" }) }, 118new object[] { "StringValues", new[] { "1", "", "3" }, new StringValues(new[] { "1", "", "3" }) }, 762["a"] = new(new[] { "1", "2", "3" }) 765httpContext.Request.Headers["Custom"] = new(new[] { "4", "5", "6" }); 769["form"] = new(new[] { "7", "8", "9" })
RequestDelegateGenerator\RequestDelegateCreationTests.cs (3)
586["a"] = new(new[] { "1", "2", "3" }) 589httpContext.Request.Headers["Custom"] = new(new[] { "4", "5", "6" }); 593["form"] = new(new[] { "7", "8", "9" })
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (1)
188["values"] = new(new[] { "1", "NAN", "3" })
Microsoft.AspNetCore.Http.Tests (3)
RequestCookiesCollectionTests.cs (3)
28var cookies = RequestCookieCollection.Parse(new StringValues(new[] { "a=a", "b=b", "c=c", "d=d", "e=e", "f=f", "g=g", "h=h", "i=i", "j=j", "k=k", "l=l" })); 43var cookies = RequestCookieCollection.Parse(new StringValues(new[] { cookieToParse })); 64var cookies = RequestCookieCollection.Parse(new StringValues(new[] { $"something={c}" }));
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
291responseHeaders.SetCookie = new StringValues(newValues.ToArray());
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheEntryFormatter.cs (1)
294value = new(values);
Microsoft.AspNetCore.OutputCaching.Tests (5)
OutputCacheMiddlewareTests.cs (5)
505new StringValues((string[])null), 506new StringValues(new string[0]), 507new StringValues(new string[] { null }), 508new StringValues(new string[] { string.Empty }) 599Assert.Equal(new StringValues(new[] { "HeaderB, heaDera" }), context.CachedResponse.FindHeader(HeaderNames.Vary));
Microsoft.AspNetCore.RequestDecompression.Tests (1)
DefaultRequestDecompressionProviderTests.cs (1)
107var contentEncodings = new StringValues(new[] { "br", "gzip" });
Microsoft.AspNetCore.ResponseCaching (3)
ResponseCachingMiddleware.cs (3)
256var varyHeaders = new StringValues(headers.GetCommaSeparatedValues(HeaderNames.Vary)); 257var varyQueryKeys = new StringValues(context.HttpContext.Features.Get<IResponseCachingFeature>()?.VaryByQueryKeys); 502return new StringValues(newArray);
Microsoft.AspNetCore.ResponseCaching.Tests (18)
ResponseCachingMiddlewareTests.cs (18)
525context.HttpContext.Response.Headers.Vary = new StringValues(new[] { "headerA", "HEADERB", "HEADERc" }); 528VaryByQueryKeys = new StringValues(new[] { "queryB", "QUERYA" }) 532Headers = new StringValues(new[] { "HeaderA", "HeaderB" }), 533QueryKeys = new StringValues(new[] { "QueryA", "QueryB" }) 554context.HttpContext.Response.Headers.Vary = new StringValues(new[] { "headerA", "HEADERB" }); 557VaryByQueryKeys = new StringValues(new[] { "queryB", "QUERYA" }) 562Headers = new StringValues(new[] { "HEADERA", "HEADERB" }), 563QueryKeys = new StringValues(new[] { "QUERYA", "QUERYB" }) 587new StringValues((string[])null), 588new StringValues(new string[0]), 589new StringValues(new string[] { null }), 590new StringValues(new string[] { string.Empty }) 680Assert.Equal(new StringValues(new[] { "HEADERA", "HEADERB" }), context.CachedVaryByRules.Headers); 928var uppercaseStrings = new StringValues(new[] { "STRINGA", "STRINGB" }); 929var lowercaseStrings = new StringValues(new[] { "stringA", "stringB" }); 939var orderedStrings = new StringValues(new[] { "STRINGA", "STRINGB" }); 940var reverseOrderStrings = new StringValues(new[] { "STRINGB", "STRINGA" }); 950var originalStrings = new StringValues(new[] { "STRINGA, STRINGB" });
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
Listener\ResponseHeaderTests.cs (1)
312responseHeaders[key] = new StringValues(new[] { "valid", value });
ResponseTrailersTests.cs (2)
273httpContext.Response.AppendTrailer("trailername", new StringValues(new[] { "TrailerValue0", "TrailerValue1" })); 301httpContext.Response.AppendTrailer("ThisIsALongerHeaderNameThatStillWorksForReals", new StringValues(values));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (8)
Http2\Http2HeadersEnumeratorTests.cs (1)
25responseHeaders.Age = new StringValues(new[] { "1", "2" });
Http2\Http2HPackEncoderTests.cs (1)
664.ToDictionary(g => g.Key, g => new StringValues(g.Select(gg => gg.Value).ToArray()));
Http3\Http3HeadersEnumeratorTests.cs (1)
25responseHeaders.Age = new StringValues(new[] { "1", "2" });
HttpHeadersTests.cs (2)
164var connection = new StringValues(new[] { value1, value2 }); 240var transferEncoding = new StringValues(new[] { value1, value2 });
HttpResponseHeadersTests.cs (3)
117((IHeaderDictionary)responseHeaders)[key] = new StringValues(new[] { "valid", value }); 211((IHeaderDictionary)responseHeaders)["Unknown"] = new StringValues(new[] { "valid", value }); 248((IHeaderDictionary)responseHeaders)["Unknown"] = new StringValues(new[] { "valid", value });
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (9)
Http2\Http2HeadersEnumeratorBenchmark.cs (8)
33_knownMultipleValueResponseHeaders.Server = new StringValues(new[] { "One", "Two" }); 34_knownMultipleValueResponseHeaders.Date = new StringValues(new[] { "One", "Two" }); 35_knownMultipleValueResponseHeaders.ContentType = new StringValues(new[] { "One", "Two" }); 36_knownMultipleValueResponseHeaders.SetCookie = new StringValues(new[] { "One", "Two" }); 45_unknownMultipleValueResponseHeaders.Append("One", new StringValues(new[] { "One", "Two" })); 46_unknownMultipleValueResponseHeaders.Append("Two", new StringValues(new[] { "One", "Two" })); 47_unknownMultipleValueResponseHeaders.Append("Three", new StringValues(new[] { "One", "Two" })); 48_unknownMultipleValueResponseHeaders.Append("Four", new StringValues(new[] { "One", "Two" }));
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
715.ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray()));
Microsoft.AspNetCore.WebUtilities (1)
KeyValueAccumulator.cs (1)
101_accumulator[entry.Key] = new StringValues(entry.Value.ToArray());
Microsoft.AspNetCore.WebUtilities.Tests (1)
QueryHelpersTests.cs (1)
193{ "param1", new StringValues(new [] { "value1", string.Empty, "value3" }) },
Microsoft.Extensions.Primitives (12)
StringValues.cs (12)
27public static readonly StringValues Empty = new StringValues(Array.Empty<string>()); 64return new StringValues(values); 469return new StringValues(combined); 494return new StringValues(combined); 519return new StringValues(combined); 606public static bool Equals(string?[]? left, StringValues right) => Equals(new StringValues(left), right); 614public static bool Equals(StringValues left, string?[]? right) => Equals(left, new StringValues(right)); 621public bool Equals(string?[]? other) => Equals(this, new StringValues(other)); 646public static bool operator ==(StringValues left, string?[]? right) => Equals(left, new StringValues(right)); 654public static bool operator !=(StringValues left, string?[]? right) => !Equals(left, new StringValues(right)); 657public static bool operator ==(string?[]? left, StringValues right) => Equals(new StringValues(left), right); 665public static bool operator !=(string?[]? left, StringValues right) => !Equals(new StringValues(left), right);
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
935var headerStringValues = new StringValues(Enumerable.Repeat(headerValue, headerCount).ToArray());