77 instantiations of ContentRangeHeaderValue
Microsoft.AspNetCore.Http.Results (2)
src\Shared\ResultsHelpers\FileResultHelper.cs (2)
316httpResponseHeaders.ContentRange = new ContentRangeHeaderValue(fileLength); 323httpResponseHeaders.ContentRange = new ContentRangeHeaderValue(
Microsoft.AspNetCore.Http.Results.Tests (15)
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (4)
54var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 34); 87var contentRange = new ContentRangeHeaderValue(0, 3, 34); 202var contentRange = new ContentRangeHeaderValue(34); 314var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 34);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (4)
66var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 33); 105var contentRange = new ContentRangeHeaderValue(0, 3, 33); 244var contentRange = new ContentRangeHeaderValue(33); 349var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 33);
Microsoft.AspNetCore.Mvc.Core (2)
src\Shared\ResultsHelpers\FileResultHelper.cs (2)
316httpResponseHeaders.ContentRange = new ContentRangeHeaderValue(fileLength); 323httpResponseHeaders.ContentRange = new ContentRangeHeaderValue(
Microsoft.AspNetCore.Mvc.Core.Test (15)
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (4)
54var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 34); 87var contentRange = new ContentRangeHeaderValue(0, 3, 34); 202var contentRange = new ContentRangeHeaderValue(34); 314var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 34);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (4)
66var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 33); 105var contentRange = new ContentRangeHeaderValue(0, 3, 33); 244var contentRange = new ContentRangeHeaderValue(33); 349var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 33);
Microsoft.AspNetCore.StaticAssets (2)
StaticAssetsInvoker.cs (2)
211requestContext.ResponseHeaders.ContentRange = new ContentRangeHeaderValue(_length); 249return new ContentRangeHeaderValue(start, end, _length);
Microsoft.AspNetCore.StaticFiles (2)
StaticFileContext.cs (2)
373ResponseHeaders.ContentRange = new ContentRangeHeaderValue(_length); 404return new ContentRangeHeaderValue(start, end, _length);
Microsoft.Net.Http.Headers (1)
ContentRangeHeaderValue.cs (1)
424var result = new ContentRangeHeaderValue();
Microsoft.Net.Http.Headers.Tests (38)
ContentRangeHeaderValueTest.cs (38)
11Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(-1)); 17var range = new ContentRangeHeaderValue(5); 30Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(-1, 1)); 31Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(0, -1)); 32Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(2, 1)); 38var range = new ContentRangeHeaderValue(0, 1); 51Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(-1, 1, 2)); 52Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(0, -1, 2)); 53Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(0, 1, -1)); 54Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(2, 1, 3)); 55Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(1, 2, 1)); 56Assert.Throws<ArgumentOutOfRangeException>(() => new ContentRangeHeaderValue(1, 2, 2)); 62var range = new ContentRangeHeaderValue(0, 1, 2); 75var range = new ContentRangeHeaderValue(0); 89var range = new ContentRangeHeaderValue(1, 2, 3); 93range = new ContentRangeHeaderValue(123456789012345678, 123456789012345679); 96range = new ContentRangeHeaderValue(150); 103var range1 = new ContentRangeHeaderValue(1, 2, 5); 104var range2 = new ContentRangeHeaderValue(1, 2); 105var range3 = new ContentRangeHeaderValue(5); 106var range4 = new ContentRangeHeaderValue(1, 2, 5); 108var range5 = new ContentRangeHeaderValue(1, 2, 5); 121var range1 = new ContentRangeHeaderValue(1, 2, 5); 122var range2 = new ContentRangeHeaderValue(1, 2); 123var range3 = new ContentRangeHeaderValue(5); 124var range4 = new ContentRangeHeaderValue(1, 2, 5); 126var range5 = new ContentRangeHeaderValue(1, 2, 5); 128var range6 = new ContentRangeHeaderValue(1, 3, 5); 129var range7 = new ContentRangeHeaderValue(2, 2, 5); 130var range8 = new ContentRangeHeaderValue(1, 2, 6); 147CheckValidParse(" bytes 1-2/3 ", new ContentRangeHeaderValue(1, 2, 3)); 148CheckValidParse("bytes * / 3", new ContentRangeHeaderValue(3)); 151new ContentRangeHeaderValue(1234567890123456789, 1234567890123456799) { Unit = "custom" }); 154new ContentRangeHeaderValue(123) { Unit = "custom" }); 178CheckValidTryParse(" bytes 1-2/3 ", new ContentRangeHeaderValue(1, 2, 3)); 179CheckValidTryParse("bytes * / 3", new ContentRangeHeaderValue(3)); 182new ContentRangeHeaderValue(1234567890123456789, 1234567890123456799) { Unit = "custom" }); 185new ContentRangeHeaderValue(123) { Unit = "custom" });
86 references to ContentRangeHeaderValue
Microsoft.AspNetCore.Http.Extensions (8)
HeaderDictionaryTypeExtensions.cs (4)
139private static ContentRangeHeaderValue? ParseCacheContentRangeHeaderValue(string value) => ContentRangeHeaderValue.TryParse(value, out var result) ? result : null; 188else if (typeof(T) == typeof(ContentRangeHeaderValue))
RequestHeaders.cs (2)
139public ContentRangeHeaderValue? ContentRange 143return Headers.Get<ContentRangeHeaderValue>(HeaderNames.ContentRange);
ResponseHeaders.cs (2)
79public ContentRangeHeaderValue? ContentRange 83return Headers.Get<ContentRangeHeaderValue>(HeaderNames.ContentRange);
Microsoft.AspNetCore.Http.Results.Tests (15)
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (4)
54var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 34); 87var contentRange = new ContentRangeHeaderValue(0, 3, 34); 202var contentRange = new ContentRangeHeaderValue(34); 314var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 34);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (4)
66var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 33); 105var contentRange = new ContentRangeHeaderValue(0, 3, 33); 244var contentRange = new ContentRangeHeaderValue(33); 349var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 33);
Microsoft.AspNetCore.Mvc.Core.Test (15)
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (4)
54var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 34); 87var contentRange = new ContentRangeHeaderValue(0, 3, 34); 202var contentRange = new ContentRangeHeaderValue(34); 314var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 34);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (4)
66var contentRange = new ContentRangeHeaderValue(startResult.Value, endResult.Value, 33); 105var contentRange = new ContentRangeHeaderValue(0, 3, 33); 244var contentRange = new ContentRangeHeaderValue(33); 349var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, 33);
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
244private ContentRangeHeaderValue ComputeContentRange(RangeItemHeaderValue range, out long start, out long length)
Microsoft.AspNetCore.StaticFiles (1)
StaticFileContext.cs (1)
399private ContentRangeHeaderValue ComputeContentRange(RangeItemHeaderValue range, out long start, out long length)
Microsoft.Net.Http.Headers (15)
ContentRangeHeaderValue.cs (15)
17private static readonly HttpHeaderParser<ContentRangeHeaderValue> Parser 18= new GenericHeaderParser<ContentRangeHeaderValue>(false, GetContentRangeLength); 28/// Initializes a new instance of <see cref="ContentRangeHeaderValue"/>. 60/// Initializes a new instance of <see cref="ContentRangeHeaderValue"/>. 74/// Initializes a new instance of <see cref="ContentRangeHeaderValue"/>. 144var other = obj as ContentRangeHeaderValue; 205/// Parses <paramref name="input"/> as a <see cref="ContentRangeHeaderValue"/> value. 209public static ContentRangeHeaderValue Parse(StringSegment input) 216/// Attempts to parse the specified <paramref name="input"/> as a <see cref="ContentRangeHeaderValue"/>. 220/// <returns><see langword="true"/> if input is a valid <see cref="ContentRangeHeaderValue"/>, otherwise <see langword="false"/>.</returns> 221public static bool TryParse(StringSegment input, [NotNullWhen(true)] out ContentRangeHeaderValue? parsedValue) 227private static int GetContentRangeLength(StringSegment input, int startIndex, out ContentRangeHeaderValue? parsedValue) 389[NotNullWhen(true)] out ContentRangeHeaderValue? parsedValue) 424var result = new ContentRangeHeaderValue();
Microsoft.Net.Http.Headers.Tests (31)
ContentRangeHeaderValueTest.cs (31)
17var range = new ContentRangeHeaderValue(5); 38var range = new ContentRangeHeaderValue(0, 1); 62var range = new ContentRangeHeaderValue(0, 1, 2); 75var range = new ContentRangeHeaderValue(0); 89var range = new ContentRangeHeaderValue(1, 2, 3); 103var range1 = new ContentRangeHeaderValue(1, 2, 5); 104var range2 = new ContentRangeHeaderValue(1, 2); 105var range3 = new ContentRangeHeaderValue(5); 106var range4 = new ContentRangeHeaderValue(1, 2, 5); 108var range5 = new ContentRangeHeaderValue(1, 2, 5); 121var range1 = new ContentRangeHeaderValue(1, 2, 5); 122var range2 = new ContentRangeHeaderValue(1, 2); 123var range3 = new ContentRangeHeaderValue(5); 124var range4 = new ContentRangeHeaderValue(1, 2, 5); 126var range5 = new ContentRangeHeaderValue(1, 2, 5); 128var range6 = new ContentRangeHeaderValue(1, 3, 5); 129var range7 = new ContentRangeHeaderValue(2, 2, 5); 130var range8 = new ContentRangeHeaderValue(1, 2, 6); 158var result = ContentRangeHeaderValue.Parse("bytes */*"); 172Assert.Throws<FormatException>(() => ContentRangeHeaderValue.Parse(input)); 189Assert.True(ContentRangeHeaderValue.TryParse("bytes */*", out var result)); 203Assert.False(ContentRangeHeaderValue.TryParse(input, out var result)); 207private static void CheckValidParse(string? input, ContentRangeHeaderValue expectedResult) 209var result = ContentRangeHeaderValue.Parse(input); 213private static void CheckValidTryParse(string? input, ContentRangeHeaderValue expectedResult) 215Assert.True(ContentRangeHeaderValue.TryParse(input, out var result));