1 implementation of IFormFile
Microsoft.AspNetCore.Http (1)
287 references to IFormFile
BasicWebSite (1)
FilesWebSite (2)
HtmlGenerationWebSite (2)
Microsoft.AspNetCore.Components.Endpoints (10)
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
Microsoft.AspNetCore.Http (8)
Microsoft.AspNetCore.Http.Extensions (11)
Microsoft.AspNetCore.Http.Extensions.Tests (30)
Microsoft.AspNetCore.Http.Features (4)
Microsoft.AspNetCore.Http.Tests (4)
Microsoft.AspNetCore.Mvc.Abstractions (1)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (18)
EndpointMetadataApiDescriptionProviderTest.cs (17)
1187builder.MapPost("/file/upload", (IFormFile formFile) => "");
1200Assert.Equal(typeof(IFormFile), bodyParameterDescription.Type);
1216builder.MapPost("/file/upload", (IFormFile? inferredFormFile) => "");
1229Assert.Equal(typeof(IFormFile), bodyParameterDescription.Type);
1245builder.MapPost("/file/upload", (IFormFile file) => Results.NoContent());
1258Assert.Equal(typeof(IFormFile), bodyParameterDescription.Type);
1273[Consumes("application/custom0", "application/custom1")] (IFormFile file) => Results.NoContent());
1289var apiDescription0 = GetApiDescription((IFormFile fromFile) => { });
1290var apiDescription1 = GetApiDescription((IFormFile? fromFile) => { });
1295Assert.Equal(typeof(IFormFile), fromFileParam0.Type);
1296Assert.Equal(typeof(IFormFile), fromFileParam0.ModelMetadata.ModelType);
1301Assert.Equal(typeof(IFormFile), fromFileParam1.Type);
1302Assert.Equal(typeof(IFormFile), fromFileParam1.ModelMetadata.ModelType);
1319AssertFormFileParameter(GetApiDescription((IFormFile file) => { }), typeof(IFormFile), "file");
1320AssertFormFileParameter(GetApiDescription(([FromForm(Name = "file_name")] IFormFile file) => { }), typeof(IFormFile), "file_name");
Microsoft.AspNetCore.Mvc.Core (35)
Microsoft.AspNetCore.Mvc.Core.Test (47)
ModelBinding\Binders\FormFileModelBinderTest.cs (28)
22var bindingContext = GetBindingContext(typeof(IEnumerable<IFormFile>), httpContext);
54new EmptyModelMetadataProvider().GetMetadataForType(typeof(IFormFile)),
169new EmptyModelMetadataProvider().GetMetadataForType(typeof(IFormFile)),
205new EmptyModelMetadataProvider().GetMetadataForType(typeof(IFormFile)),
229var bindingContext = GetBindingContext(typeof(IEnumerable<IFormFile>), httpContext);
243var files = Assert.IsAssignableFrom<IList<IFormFile>>(bindingContext.Result.Model);
248[InlineData(typeof(IFormFile[]))]
249[InlineData(typeof(ICollection<IFormFile>))]
250[InlineData(typeof(IList<IFormFile>))]
252[InlineData(typeof(List<IFormFile>))]
253[InlineData(typeof(LinkedList<IFormFile>))]
270Assert.Equal(formFiles, bindingContext.Result.Model as IEnumerable<IFormFile>);
279var bindingContext = GetBindingContext(typeof(IFormFile), httpContext);
287var file = Assert.IsAssignableFrom<IFormFile>(bindingContext.Result.Model);
297var bindingContext = GetBindingContext(typeof(IFormFile), httpContext);
317var bindingContext = GetBindingContext(typeof(IFormFile), httpContext);
341var bindingContext = GetBindingContext(typeof(IFormFile), httpContext);
353var file = Assert.IsAssignableFrom<IFormFile>(bindingContext.Result.Model);
364new Mock<IFormFile>().Object
367var bindingContext = GetBindingContext(typeof(IFormFile), httpContext);
387var bindingContext = GetBindingContext(typeof(IFormFile), httpContext);
422var bindingContext = GetBindingContext(typeof(ISet<IFormFile>), httpContext);
499private static IFormFile GetMockFormFile(string modelName, string filename)
501var formFile = new Mock<IFormFile>();
510public IFormFile[] ArrayProperty { get; }
513private class FileList : List<IFormFile>
Microsoft.AspNetCore.Mvc.IntegrationTests (49)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
Microsoft.AspNetCore.Mvc.Test (3)
Microsoft.AspNetCore.Mvc.ViewFeatures (8)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
TemplateRendererTest.cs (4)
32{ typeof(IFormFile), new string[] { "IFormFile", "Object" } },
34{ typeof(FormFileCollection), new string[] { "FormFileCollection", typeof(List<IFormFile>).Name,
38{ typeof(IEnumerable<IFormFile>), new string[] { TemplateRenderer.IEnumerableOfIFormFileName,
39typeof(IEnumerable<IFormFile>).Name, "Collection", "Object" } },
Microsoft.AspNetCore.OpenApi (6)
Microsoft.AspNetCore.OpenApi.Tests (26)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (12)
24builder.MapPost("/", ([FromForm] IFormFile formFile) => { });
28builder.MapPost("/", (IFormFile formFile) => { });
62builder.MapPost("/", (IFormFile? formFile) => { });
66builder.MapPost("/", (IFormFile formFile) => { });
173builder.MapPost("/", (IFormFile formFile1, IFormFile formFile2) => { });
213builder.MapPost("/", (IFormFile formFile) => { }).Accepts(typeof(IFormFile), "application/magic-foo-content-type");
240builder.MapPost("/", [Consumes(typeof(IFormFile), "application/magic-foo-content-type")] (IFormFile formFile) => { });
951builder.MapGet("/api/", ([FromForm] Todo todo, IFormFile formFile, [FromForm] Guid guid) => { });
1076private void ActionWithMixedFormTypes([FromForm] Todo todo, IFormFile formFile, [FromForm] Guid guid) { }
Microsoft.AspNetCore.Routing.FunctionalTests (2)
RazorPagesWebSite (3)
Sample (4)
SimpleWebSiteWithWebApplicationBuilder (1)