1 implementation of IFormFile
Microsoft.AspNetCore.Http (1)
276 references to IFormFile
BasicWebSite (1)
FilesWebSite (2)
Microsoft.AspNetCore.Components.Endpoints (10)
Microsoft.AspNetCore.Components.Endpoints.Tests (9)
Microsoft.AspNetCore.Http (8)
Microsoft.AspNetCore.Http.Extensions (11)
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)
1430builder.MapPost("/file/upload", (IFormFile formFile) => "");
1443Assert.Equal(typeof(IFormFile), bodyParameterDescription.Type);
1459builder.MapPost("/file/upload", (IFormFile? inferredFormFile) => "");
1472Assert.Equal(typeof(IFormFile), bodyParameterDescription.Type);
1488builder.MapPost("/file/upload", (IFormFile file) => Results.NoContent());
1501Assert.Equal(typeof(IFormFile), bodyParameterDescription.Type);
1516[Consumes("application/custom0", "application/custom1")] (IFormFile file) => Results.NoContent());
1532var apiDescription0 = GetApiDescription((IFormFile fromFile) => { });
1533var apiDescription1 = GetApiDescription((IFormFile? fromFile) => { });
1538Assert.Equal(typeof(IFormFile), fromFileParam0.Type);
1539Assert.Equal(typeof(IFormFile), fromFileParam0.ModelMetadata.ModelType);
1544Assert.Equal(typeof(IFormFile), fromFileParam1.Type);
1545Assert.Equal(typeof(IFormFile), fromFileParam1.ModelMetadata.ModelType);
1562AssertFormFileParameter(GetApiDescription((IFormFile file) => { }), typeof(IFormFile), "file");
1563AssertFormFileParameter(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 (5)
Microsoft.AspNetCore.OpenApi.Tests (26)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (12)
26builder.MapPost("/", ([FromForm] IFormFile formFile) => { });
30builder.MapPost("/", (IFormFile formFile) => { });
64builder.MapPost("/", (IFormFile? formFile) => { });
68builder.MapPost("/", (IFormFile formFile) => { });
177builder.MapPost("/", (IFormFile formFile1, IFormFile formFile2) => { });
217builder.MapPost("/", (IFormFile formFile) => { }).Accepts(typeof(IFormFile), "application/magic-foo-content-type");
244builder.MapPost("/", [Consumes(typeof(IFormFile), "application/magic-foo-content-type")] (IFormFile formFile) => { });
955builder.MapGet("/api/", ([FromForm] Todo todo, IFormFile formFile, [FromForm] Guid guid) => { });
1080private void ActionWithMixedFormTypes([FromForm] Todo todo, IFormFile formFile, [FromForm] Guid guid) { }
Microsoft.AspNetCore.Routing.FunctionalTests (2)
Sample (24)
artifacts\obj\Sample\Release\net10.0\generated\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs (20)
196var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0) => throw null!);
213return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.IFormFile>(0)!));
228var resume_raw = httpContext.Request.Form.Files["resume"];
234var resume_temp = resume_raw;
235global::Microsoft.AspNetCore.Http.IFormFile resume_local = resume_temp!;
259var resume_raw = httpContext.Request.Form.Files["resume"];
265var resume_temp = resume_raw;
266global::Microsoft.AspNetCore.Http.IFormFile resume_local = resume_temp!;
272var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.IFormFile>(httpContext, resume_local!));
283var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0) => throw null!);
439var handler = Cast(del, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0, global::Microsoft.AspNetCore.Http.IFormFileCollection arg1) => throw null!);
456return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.IFormFile>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.IFormFileCollection>(1)!));
471var resume_raw = httpContext.Request.Form.Files["resume"];
477var resume_temp = resume_raw;
478global::Microsoft.AspNetCore.Http.IFormFile resume_local = resume_temp!;
511var resume_raw = httpContext.Request.Form.Files["resume"];
517var resume_temp = resume_raw;
518global::Microsoft.AspNetCore.Http.IFormFile resume_local = resume_temp!;
533var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.IFormFile, global::Microsoft.AspNetCore.Http.IFormFileCollection>(httpContext, resume_local!, files_local!));
544var castHandler = Cast(handler, global::Microsoft.AspNetCore.Http.IResult (global::Microsoft.AspNetCore.Http.IFormFile arg0, global::Microsoft.AspNetCore.Http.IFormFileCollection arg1) => throw null!);
SimpleWebSiteWithWebApplicationBuilder (1)