94 references to StringValues
HeaderPropagationSample (1)
Startup.cs (1)
121return new StringValues("none");
InMemory.FunctionalTests (3)
Http2\Http2ConnectionTests.cs (1)
2437Headers[nameString] = new StringValues(valueString);
ResponseHeaderTests.cs (2)
114context.Response.Headers.Add(tag, new StringValues((string)null)); 119context.Response.Headers.Add(tag, new StringValues("Hello"));
Microsoft.AspNetCore.Components.Endpoints (1)
Builder\ResourceCollectionUrlEndpoint.cs (1)
221context.Response.Headers.ETag = new StringValues(_contentETag);
Microsoft.AspNetCore.Components.Endpoints.Tests (10)
Binding\FormDataMapperTests.cs (10)
26var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues(value) }; 46var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues(value) }; 66var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues(value) }; 119var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues("abc") }; 136var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues("abc") }; 162var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues(value) }; 196var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues(value) }; 213var collection = new Dictionary<string, StringValues>() { ["value.Slug"] = new StringValues(value) }; 239var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues("(1,1)") }; 257var collection = new Dictionary<string, StringValues>() { ["value"] = new StringValues("(1,1)") };
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Latency\ChecpointAcceptanceTests.cs (1)
74var alreadySetServerTimingHeader = new StringValues("Already-Set-Some-Header;blabla");
Microsoft.AspNetCore.HeaderParsing.Tests (29)
ParserTests.cs (29)
20var sv = new StringValues("web.vortex.data.microsoft.com"); 38var sv = new StringValues("Wed, 21 Oct 2015 07:28:14 GMT"); 53var sv = new StringValues(string.Empty); 61var sv = new StringValues("Hello World"); 77var sv = new StringValues("csrftoken=u32t4o3tb3gg43"); 88var sv = new StringValues("csrftoken=u32t4o3tb3gg43; _gat=1"); 101var sv = new StringValues(string.Empty); 110var sv = new StringValues("HelloWorld"); 119var sv = new StringValues("public, max-age=604800"); 129var sv = new StringValues("ZZZ=ZZZ=ZZZ=ZZZ"); 147var sv = new StringValues("attachment; filename=\"cool.html\""); 166var sv = new StringValues("zz=zz=zz"); 175var sv = new StringValues("text/html; charset=UTF-8"); 194var sv = new StringValues(string.Empty); 203var sv = new StringValues("text/html; charset=UTF-8"); 214var sv = new StringValues(string.Empty); 223var sv = new StringValues("\"HelloWorld\""); 233var sv = new StringValues(string.Empty); 242var sv = new StringValues("en-US"); 252var sv = new StringValues("en-US,en;q=0.5"); 264var sv = new StringValues(string.Empty); 273var sv = new StringValues("https://foo.com:81"); 292var sv = new StringValues("http://localhost:XXX"); 301var sv = new StringValues("bytes=200-1000"); 322var sv = new StringValues("Hello World"); 331var sv = new StringValues("Wed, 21 Oct 2015 07:28:14 GMT"); 342sv = new StringValues("\"67ab43\""); 360var sv = new StringValues("Hello World"); 425var sv = new StringValues(",1.1.1.1");
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
HeaderPropagationMiddlewareTest.cs (1)
137Assert.Equal(new StringValues("value"), receivedValue);
Microsoft.AspNetCore.Http (1)
Features\QueryFeature.cs (1)
142_accumulator[key] = new StringValues(value);
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (2)
GetHeaderSplitBenchmark.cs (2)
18{ "singleValue", new StringValues("single") }, 19{ "singleValueQuoted", new StringValues("\"single\"") },
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
QueryStringTests.cs (4)
82new KeyValuePair<string, StringValues>("key1", new StringValues("value1")), 83new KeyValuePair<string, StringValues>("key2", new StringValues("value2")), 84new KeyValuePair<string, StringValues>("key3", new StringValues("value3")), 86new KeyValuePair<string, StringValues>("key5", new StringValues("")),
Microsoft.AspNetCore.Http.Extensions (2)
HeaderDictionaryTypeExtensions.cs (2)
76headers[name] = new StringValues(values[0]!.ToString()); 107Headers.Append(name, new StringValues(values[0]!.ToString()));
Microsoft.AspNetCore.Http.Tests (1)
RequestCookiesCollectionTests.cs (1)
18var cookies = RequestCookieCollection.Parse(new StringValues(input));
Microsoft.AspNetCore.HttpsPolicy (1)
HstsMiddleware.cs (1)
44_strictTransportSecurityValue = new StringValues($"max-age={maxAge}{includeSubdomains}{preload}");
Microsoft.AspNetCore.Mvc.Core.Test (3)
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
261.Returns(new ValueProviderResult(new StringValues("foo,bar")));
ModelBinding\FormValueProviderTest.cs (1)
21{ FormValueHelper.CultureInvariantFieldName, new(invariantCultureKey) },
ModelBinding\JQueryFormValueProviderTest.cs (1)
59{ FormValueHelper.CultureInvariantFieldName, new(invariantCultureKey) },
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheEntryFormatter.cs (1)
285value = new(useCommonHeaders ? ReadCommonHeader(ref reader) : reader.ReadString());
Microsoft.AspNetCore.OutputCaching.Tests (2)
OutputCacheMiddlewareTests.cs (2)
503new StringValues((string)null), 504new StringValues(string.Empty),
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
487return new StringValues(stringValues.ToString().ToUpperInvariant());
Microsoft.AspNetCore.ResponseCaching.Tests (2)
ResponseCachingMiddlewareTests.cs (2)
585new StringValues((string)null), 586new StringValues(string.Empty),
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
RequestHeaderTests.cs (1)
90var header = KeyValuePair.Create("Custom-Header", new StringValues("custom"));
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Http\HttpHeaders.Generated.cs (5)
586return new StringValues(HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value)); 7907values = new StringValues(valueStr); 8123values = new StringValues(valueStr); 8326values = new StringValues(valueStr); 8803return new StringValues(HeaderUtilities.FormatNonNegativeInt64(_contentLength.Value));
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (8)
Http2\Http2ConnectionBenchmarkBase.cs (4)
53_httpRequestHeaders[InternalHeaderNames.Method] = new StringValues("GET"); 54_httpRequestHeaders[InternalHeaderNames.Path] = new StringValues("/"); 55_httpRequestHeaders[InternalHeaderNames.Scheme] = new StringValues("http"); 56_httpRequestHeaders[InternalHeaderNames.Authority] = new StringValues("localhost:80");
Http3\Http3ConnectionBenchmarkBase.cs (4)
39_httpRequestHeaders[InternalHeaderNames.Method] = new StringValues("GET"); 40_httpRequestHeaders[InternalHeaderNames.Path] = new StringValues("/"); 41_httpRequestHeaders[InternalHeaderNames.Scheme] = new StringValues("http"); 42_httpRequestHeaders[InternalHeaderNames.Authority] = new StringValues("localhost:80");
Microsoft.AspNetCore.WebUtilities (1)
KeyValueAccumulator.cs (1)
66_accumulator[key] = new StringValues(value);
Microsoft.Extensions.Primitives (10)
StringValues.cs (10)
55return new StringValues(value); 488return new StringValues(value); 513return new StringValues(value); 583public static bool Equals(string? left, StringValues right) => Equals(new StringValues(left), right); 591public static bool Equals(StringValues left, string? right) => Equals(left, new StringValues(right)); 598public bool Equals(string? other) => Equals(this, new StringValues(other)); 624public static bool operator ==(StringValues left, string? right) => Equals(left, new StringValues(right)); 632public static bool operator !=(StringValues left, string? right) => !Equals(left, new StringValues(right)); 635public static bool operator ==(string? left, StringValues right) => Equals(new StringValues(left), right); 643public static bool operator !=(string? left, StringValues right) => !Equals(new StringValues(left), right);
Microsoft.Net.Http.Headers.Tests (3)
HeaderUtilitiesTest.cs (3)
76Assert.True(HeaderUtilities.TryParseSeconds(new StringValues(headerValues), targetValue, out value)); 96Assert.False(HeaderUtilities.TryParseSeconds(new StringValues(headerValues), targetValue!, out value)); 173Assert.Equal(contains, HeaderUtilities.ContainsCacheDirective(new StringValues(headerValues), targetValue!));