3 implementations of IFormFileCollection
Microsoft.AspNetCore.Http (1)
FormFileCollection.cs (1)
9public class FormFileCollection : List<IFormFile>, IFormFileCollection
Microsoft.AspNetCore.Mvc.Core (2)
ModelBinding\Binders\FormCollectionModelBinder.cs (1)
88private sealed class EmptyFormFileCollection : List<IFormFile>, IFormFileCollection
ModelBinding\Binders\FormFileModelBinder.cs (1)
170private sealed class FileCollection : ReadOnlyCollection<IFormFile>, IFormFileCollection
92 references to IFormFileCollection
ApiExplorerWebSite (1)
Controllers\ApiExplorerApiController.cs (1)
28public void ActionWithFormFileCollectionParameter(IFormFileCollection formFile)
HtmlGenerationWebSite (1)
Models\Folder.cs (1)
10public IFormFileCollection InterfaceFiles { get; set; }
Microsoft.AspNetCore.Components.Endpoints (13)
FormMapping\Converters\FileConverter.cs (2)
59if (typeof(T) == typeof(IFormFileCollection)) 66var formFileCollection = reader.FormFileCollection;
FormMapping\Factories\FileConverterFactory.cs (1)
22private static bool CanConvertCommon(Type type) => type == typeof(IFormFile) || type == typeof(IFormFileCollection) || type == typeof(IReadOnlyList<IFormFile>);
FormMapping\FormDataReader.cs (2)
37public FormDataReader(IReadOnlyDictionary<FormKey, StringValues> formCollection, CultureInfo culture, Memory<char> buffer, IFormFileCollection formFileCollection) 47public IFormFileCollection? FormFileCollection { get; internal set; }
FormMapping\HttpContextFormDataProvider.cs (4)
15private IFormFileCollection? _formFiles; 21public IFormFileCollection FormFiles => _formFiles ?? (IFormFileCollection)FormCollection.Empty; 23public void SetFormData(string incomingHandlerName, IReadOnlyDictionary<string, StringValues> form, IFormFileCollection formFiles)
FormMapping\HttpContextFormValueMapper.cs (2)
104IFormFileCollection formFiles); 115IFormFileCollection formFiles)
FormMapping\WellKnownConverters.cs (2)
46{ typeof(IFormFileCollection), new FileConverter<IFormFileCollection>() },
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
Binding\FormDataMapperTests.cs (2)
78private FormDataReader CreateFormDataReader(Dictionary<string, StringValues> collection, CultureInfo invariantCulture, IFormFileCollection formFileCollection = null) 2000var result = CallDeserialize(reader, options, typeof(IFormFileCollection));
Microsoft.AspNetCore.Http (5)
FormCollection.cs (4)
28private static readonly IFormFileCollection EmptyFiles = new FormFileCollection(); 30private IFormFileCollection? _files; 42public FormCollection(Dictionary<string, StringValues>? fields, IFormFileCollection? files = null) 52public IFormFileCollection Files
FormFileCollection.cs (1)
7/// Default implementation of <see cref="IFormFileCollection"/>.
Microsoft.AspNetCore.Http.Extensions (12)
RequestDelegateFactory.cs (5)
70private static readonly PropertyInfo FormFilesIndexerProperty = typeof(IFormFileCollection).GetProperty("Item")!; 121private static readonly ConstructorInfo FormDataReaderConstructor = typeof(FormDataReader).GetConstructor(new[] { typeof(IReadOnlyDictionary<FormKey, StringValues>), typeof(CultureInfo), typeof(Memory<char>), typeof(IFormFileCollection) })!; 757if (parameter.ParameterType == typeof(IFormFileCollection)) 762$"Assigning a value to the {nameof(IFromFormMetadata)}.{nameof(IFromFormMetadata.Name)} property is not supported for parameters of type {nameof(IFormFileCollection)}."); 850else if (parameter.ParameterType == typeof(IFormFileCollection))
src\Components\Endpoints\src\FormMapping\Converters\FileConverter.cs (2)
59if (typeof(T) == typeof(IFormFileCollection)) 66var formFileCollection = reader.FormFileCollection;
src\Components\Endpoints\src\FormMapping\Factories\FileConverterFactory.cs (1)
22private static bool CanConvertCommon(Type type) => type == typeof(IFormFile) || type == typeof(IFormFileCollection) || type == typeof(IReadOnlyList<IFormFile>);
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (2)
37public FormDataReader(IReadOnlyDictionary<FormKey, StringValues> formCollection, CultureInfo culture, Memory<char> buffer, IFormFileCollection formFileCollection) 47public IFormFileCollection? FormFileCollection { get; internal set; }
src\Components\Endpoints\src\FormMapping\WellKnownConverters.cs (2)
46{ typeof(IFormFileCollection), new FileConverter<IFormFileCollection>() },
Microsoft.AspNetCore.Http.Extensions.Tests (9)
RequestDelegateFactoryTests.cs (4)
1992void TestFormFileCollectionAndJson(IFormFileCollection value1, Todo value2) { } 1998void TestJsonAndFormFileCollection(Todo value1, IFormFileCollection value2) { } 2020IFormFileCollection? formFilesArgument = null; 2022void TestAction([FromForm(Name = "foo")] IFormFileCollection formFiles)
RequestDelegateFactoryTests.FormMapping.cs (1)
323public IFormFileCollection? FormFileCollection { get; set; }
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (4)
42var formFilesArgument = Assert.IsAssignableFrom<IFormFileCollection>(httpContext.Items["formFiles"]); 77var formFiles = Assert.IsAssignableFrom<IFormFileCollection>(httpContext.Items["formFiles"]);
Microsoft.AspNetCore.Http.Features (3)
IFormCollection.cs (1)
105IFormFileCollection Files { get; }
IFormFileCollection.cs (2)
31/// <see cref="IFormFileCollection" /> with the specified name. 36/// that implements <see cref="IFormFileCollection" />.
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\BindingSource.cs (1)
99/// A <see cref="BindingSource"/> for <see cref="IFormFile"/>, <see cref="IFormCollection"/>, and <see cref="IFormFileCollection"/>.
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointMetadataApiDescriptionProvider.cs (1)
303else if (parameterType == typeof(IFormFile) || parameterType == typeof(IFormFileCollection))
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (3)
EndpointMetadataApiDescriptionProviderTest.cs (3)
1326AssertFormFileCollection((IFormFileCollection files) => Results.NoContent(), "files"); 1327AssertFormFileCollection(([FromForm] IFormFileCollection uploads) => Results.NoContent(), "uploads"); 1346Assert.Equal(typeof(IFormFileCollection), bodyParameterDescription.Type);
Microsoft.AspNetCore.Mvc.Core (15)
ApiBehaviorOptions.cs (1)
42/// Parameters of type <see cref="IFormFile"/> and <see cref="IFormFileCollection"/> are assumed to be bound from form.
Infrastructure\MvcCoreMvcOptionsSetup.cs (2)
119modelMetadataDetailsProviders.Add(new BindingSourceMetadataProvider(typeof(IFormFileCollection), BindingSource.FormFile)); 133modelMetadataDetailsProviders.Add(new SuppressChildValidationMetadataProvider(typeof(IFormFileCollection)));
ModelBinding\Binders\FormCollectionModelBinder.cs (2)
62public IFormFileCollection Files => new EmptyFormFileCollection(); 94IReadOnlyList<IFormFile> IFormFileCollection.GetFiles(string name) => Array.Empty<IFormFile>();
ModelBinding\Binders\FormFileModelBinder.cs (2)
40var createFileCollection = bindingContext.ModelType == typeof(IFormFileCollection); 108else if (modelType == typeof(IFormFileCollection))
ModelBinding\Binders\FormFileModelBinderProvider.cs (2)
14/// of <see cref="IFormFile"/>, and <see cref="IFormFileCollection"/>. 26modelType == typeof(IFormFileCollection) ||
ModelBinding\FormFileValueProvider.cs (6)
11/// An <see cref="IValueProvider"/> adapter for data stored in an <see cref="IFormFileCollection"/>. 20private readonly IFormFileCollection _files; 24/// Creates a value provider for <see cref="IFormFileCollection"/>. 26/// <param name="files">The <see cref="IFormFileCollection"/>.</param> 27public FormFileValueProvider(IFormFileCollection files) 41private static PrefixContainer CreatePrefixContainer(IFormFileCollection formFiles)
Microsoft.AspNetCore.Mvc.Core.Test (7)
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (1)
82public IActionResult FormFileCollectionParameter(IFormFileCollection formFiles) => null;
ApplicationModels\DefaultApplicationModelProviderTest.cs (1)
1779public IActionResult PostAction([FromQuery] string fromQuery, IFormFileCollection formFileCollection, string unbound) => null;
ApplicationModels\InferParameterBindingInfoConventionTest.cs (3)
983public IActionResult FormFileCollectionParameter(IFormFileCollection formFiles) => null; 1048public IActionResult FromFormFormFileParameters([FromForm] IFormFile p1, [FromForm] IFormFile[] p2, [FromForm] IFormFileCollection p3) => null; 1050public IActionResult FormFileParameters(IFormFile p1, IFormFile[] p2, IFormFileCollection p3) => null;
ModelBinding\Binders\FormFileModelBinderProviderTest.cs (1)
32[InlineData(typeof(IFormFileCollection))]
ModelBinding\Binders\FormFileModelBinderTest.cs (1)
251[InlineData(typeof(IFormFileCollection))]
Microsoft.AspNetCore.Mvc.Test (2)
MvcOptionsSetupTest.cs (2)
193Assert.Equal(typeof(IFormFileCollection), formFileParameter.Type); 255Assert.Equal(typeof(IFormFileCollection), excludeFilter.Type);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
TemplateRendererTest.cs (1)
36{ typeof(IFormFileCollection), new string[] { "IFormFileCollection",
Microsoft.AspNetCore.OpenApi (6)
Extensions\JsonTypeInfoExtensions.cs (1)
34[typeof(IFormFileCollection)] = "IFormFileCollection",
Services\OpenApiDocumentService.cs (1)
525if (description.Type == typeof(IFormFile) || description.Type == typeof(IFormFileCollection))
Services\OpenApiGenerator.cs (2)
296var isFormType = requestBodyParameter.ParameterType == typeof(IFormFile) || requestBodyParameter.ParameterType == typeof(IFormFileCollection); 446else if (parameter.ParameterType == typeof(IFormFile) || parameter.ParameterType == typeof(IFormFileCollection))
Services\Schemas\OpenApiSchemaService.cs (1)
73else if (type == typeof(IFormFileCollection))
Services\Schemas\OpenApiSchemaStore.cs (1)
27[new OpenApiSchemaKey(typeof(IFormFileCollection), null)] = new JsonObject
Microsoft.AspNetCore.OpenApi.Tests (8)
Extensions\JsonTypeInfoExtensionsTests.cs (1)
45[typeof(IFormFileCollection), "IFormFileCollection"],
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Parameters.cs (1)
155builder.MapPost("/api/users", (IFormFile formFile, IFormFileCollection formFiles) => { });
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (4)
100builder.MapPost("/", ([FromForm] IFormFileCollection formFileCollection) => { }); 104builder.MapPost("/", (IFormFileCollection formFileCollection) => { }); 139builder.MapPost("/", (IFormFileCollection? formFile) => { }); 143builder.MapPost("/", (IFormFileCollection formFile) => { });
Services\OpenApiGeneratorTests.cs (2)
839AssertFormFileCollection((IFormFileCollection files) => Results.NoContent(), "files"); 840AssertFormFileCollection(([FromForm] IFormFileCollection uploads) => Results.NoContent(), "uploads");
Sample (2)
Program.cs (2)
57forms.MapPost("/form-files", (IFormFileCollection files) => Results.Ok(files.Count)); 58forms.MapPost("/form-file-multiple", (IFormFile resume, IFormFileCollection files) => Results.Ok(files.Count + resume.FileName));