2 implementations of IFormCollection
Microsoft.AspNetCore.Http (1)
FormCollection.cs (1)
16public class FormCollection : IFormCollection
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Binders\FormCollectionModelBinder.cs (1)
56private sealed class EmptyFormCollection : IFormCollection
125 references to IFormCollection
Microsoft.AspNetCore.Antiforgery (1)
Internal\DefaultAntiforgeryTokenStore.cs (1)
55IFormCollection form;
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
OpenIdConnectHandler.cs (2)
123var form = await Request.ReadFormAsync(Context.RequestAborted); 666var form = await Request.ReadFormAsync(Context.RequestAborted);
Microsoft.AspNetCore.Authentication.WsFederation (1)
WsFederationHandler.cs (1)
160var form = await Request.ReadFormAsync(Context.RequestAborted);
Microsoft.AspNetCore.Components.Endpoints (4)
Rendering\EndpointHtmlRenderer.cs (4)
77IFormCollection? form = null) 224private readonly IFormCollection _form; 227public FormCollectionReadOnlyDictionary(IFormCollection form) 238private static List<StringValues> MaterializeValues(IFormCollection form)
Microsoft.AspNetCore.Components.Server (1)
CircuitDisconnectMiddleware.cs (1)
61var form = await context.Request.ReadFormAsync();
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
MigrationsEndPointMiddleware.cs (1)
97var form = await context.Request.ReadFormAsync();
Microsoft.AspNetCore.Http (13)
Features\FormFeature.cs (9)
22private Task<IFormCollection>? _parsedFormTask; 23private IFormCollection? _form; 29/// <param name="form">The <see cref="IFormCollection"/> to use as the backing store.</param> 30public FormFeature(IFormCollection form) 115public IFormCollection? Form 138public IFormCollection ReadForm() 156public Task<IFormCollection> ReadFormAsync() => ReadFormAsync(CancellationToken.None); 159public Task<IFormCollection> ReadFormAsync(CancellationToken cancellationToken) 177private async Task<IFormCollection> InnerReadFormAsync(CancellationToken cancellationToken)
FormCollection.cs (1)
128/// is also used via the <see cref="IFormCollection" /> interface.
Internal\DefaultHttpRequest.cs (2)
155public override IFormCollection Form 161public override Task<IFormCollection> ReadFormAsync(CancellationToken cancellationToken)
RequestFormReaderExtensions.cs (1)
21public static Task<IFormCollection> ReadFormAsync(this HttpRequest request, FormOptions options,
Microsoft.AspNetCore.Http.Abstractions (3)
HttpRequest.cs (3)
138public abstract IFormCollection Form { get; set; } 147public abstract Task<IFormCollection> ReadFormAsync(CancellationToken cancellationToken = new CancellationToken()); 178public IFormCollection? Form => _request.HttpContext.Features.Get<IFormFeature>()?.Form;
Microsoft.AspNetCore.Http.Extensions (7)
RequestDelegateFactory.cs (7)
71private static readonly PropertyInfo FormIndexerProperty = typeof(IFormCollection).GetProperty("Item")!; 102private static readonly MemberExpression FormFilesExpr = Expression.Property(FormExpr, typeof(IFormCollection).GetProperty(nameof(IFormCollection.Files))!); 771else if (parameter.ParameterType == typeof(IFormCollection)) 776$"Assigning a value to the {nameof(IFromFormMetadata)}.{nameof(IFromFormMetadata.Name)} property is not supported for parameters of type {nameof(IFormCollection)}."); 846else if (parameter.ParameterType == typeof(IFormCollection)) 2221private static void ProcessForm(IFormCollection form, int maxKeyBufferSize, ref IReadOnlyDictionary<FormKey, StringValues> formDictionary, ref char[] buffer)
Microsoft.AspNetCore.Http.Extensions.Tests (11)
RequestDelegateFactoryTests.cs (5)
1994void TestFormCollectionAndJson(IFormCollection value1, Todo value2) { } 2000void TestJsonAndFormCollection(Todo value1, IFormCollection value2) { } 2069IFormCollection? formArgument = null; 2071void TestAction([FromForm(Name = "foo")] IFormCollection formCollection) 2900var @delegate = void (IFormCollection formCollection) => { };
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (6)
557var formArgument = Assert.IsAssignableFrom<IFormCollection>(httpContext.Items["formFiles"]); 604var formArgument = Assert.IsAssignableFrom<IFormCollection>(httpContext.Items["formFiles"]); 836var formArgument = Assert.IsAssignableFrom<IFormCollection>(httpContext.Items["FormArgument"]);
Microsoft.AspNetCore.Http.Features (13)
IFormCollection.cs (9)
14/// Gets the number of elements contained in the <see cref="IFormCollection" />. 17/// The number of elements contained in the <see cref="IFormCollection" />. 23/// <see cref="IFormCollection" />. 27/// that implements <see cref="IFormCollection" />. 32/// Determines whether the <see cref="IFormCollection" /> contains an element 36/// The key to locate in the <see cref="IFormCollection" />. 39/// true if the <see cref="IFormCollection" /> contains an element with 60/// true if the object that implements <see cref="IFormCollection" /> contains 85/// <see cref="IFormCollection" /> has a different indexer contract than
IFormFeature.cs (4)
24IFormCollection? Form { get; set; } 34/// <returns>The <see cref="IFormCollection"/>.</returns> 35IFormCollection ReadForm(); 42Task<IFormCollection> ReadFormAsync(CancellationToken cancellationToken);
Microsoft.AspNetCore.Http.Tests (10)
Features\FormFeatureTests.cs (10)
23var formCollection = await context.Request.ReadFormAsync(); 61var formCollection = await context.Request.ReadFormAsync(); 103var formCollection = await context.Request.ReadFormAsync(); 211var formCollection = context.Request.Form; 246var formCollection = context.Request.Form; 283var formCollection = await context.Request.ReadFormAsync(); 331var formCollection = context.Request.Form; 368var formCollection = await context.Request.ReadFormAsync(); 416var formCollection = await context.Request.ReadFormAsync(); 565var formCollection = await context.Request.ReadFormAsync();
Microsoft.AspNetCore.HttpOverrides (1)
HttpMethodOverrideMiddleware.cs (1)
61var form = await context.Request.ReadFormAsync();
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.Core (15)
Infrastructure\MvcCoreMvcOptionsSetup.cs (2)
118modelMetadataDetailsProviders.Add(new BindingSourceMetadataProvider(typeof(IFormCollection), BindingSource.FormFile)); 132modelMetadataDetailsProviders.Add(new SuppressChildValidationMetadataProvider(typeof(IFormCollection)));
ModelBinding\Binders\FormCollectionModelBinder.cs (2)
15/// <see cref="IModelBinder"/> implementation to bind form values to <see cref="IFormCollection"/>. 43var form = await request.ReadFormAsync();
ModelBinding\Binders\FormCollectionModelBinderProvider.cs (3)
14/// An <see cref="IModelBinderProvider"/> for <see cref="IFormCollection"/>. 31typeof(IFormCollection).FullName)); 34if (modelType == typeof(IFormCollection))
ModelBinding\Binders\FormFileModelBinder.cs (1)
143var form = await request.ReadFormAsync();
ModelBinding\FormFileValueProviderFactory.cs (1)
33IFormCollection form;
ModelBinding\FormValueProvider.cs (4)
12/// An <see cref="IValueProvider"/> adapter for data stored in an <see cref="IFormCollection"/>. 16private readonly IFormCollection _values; 21/// Creates a value provider for <see cref="IFormCollection"/>. 28IFormCollection values,
ModelBinding\FormValueProviderFactory.cs (1)
35IFormCollection form;
ModelBinding\JQueryFormValueProviderFactory.cs (1)
36IFormCollection formCollection;
Microsoft.AspNetCore.Mvc.Core.Test (13)
ModelBinding\Binders\FormCollectionModelBinderProviderTest.cs (2)
23$"The '{typeof(FormCollectionModelBinder).FullName}' cannot bind to a model of type '{modelType.FullName}'. Change the model type to '{typeof(IFormCollection).FullName}' instead.", 49var context = new TestModelBinderProviderContext(typeof(IFormCollection));
ModelBinding\Binders\FormCollectionModelBinderTest.cs (7)
24var bindingContext = GetBindingContext(typeof(IFormCollection), httpContext); 34var form = Assert.IsAssignableFrom<IFormCollection>(bindingContext.Result.Model); 45var bindingContext = GetBindingContext(typeof(IFormCollection), httpContext); 53var form = Assert.IsAssignableFrom<IFormCollection>(bindingContext.Result.Model); 57private static HttpContext GetMockHttpContext(IFormCollection formCollection, bool hasForm = true)
ModelBinding\Binders\FormFileModelBinderProviderTest.cs (1)
13[InlineData(typeof(IFormCollection))]
ModelBinding\Binders\FormFileModelBinderTest.cs (3)
472private static HttpContext GetMockHttpContext(IFormCollection formCollection) 492private static IFormCollection GetMockFormCollection(FormFileCollection formFiles) 494var formCollection = new Mock<IFormCollection>();
Microsoft.AspNetCore.Mvc.IntegrationTests (17)
FormCollectionModelBindingIntegrationTest.cs (9)
23public IFormCollection FileCollection { get; set; } 59var formCollection = Assert.IsAssignableFrom<IFormCollection>(boundPerson.Address.FileCollection); 86ParameterType = typeof(IFormCollection) 106var formCollection = Assert.IsAssignableFrom<IFormCollection>(modelBindingResult.Model); 130ParameterType = typeof(IFormCollection) 144var collection = Assert.IsAssignableFrom<IFormCollection>(modelBindingResult.Model);
GenericModelBinderIntegrationTest.cs (8)
28ParameterType = typeof(List<IFormCollection>) 45var model = Assert.IsType<List<IFormCollection>>(modelBindingResult.Model); 46var formCollection = Assert.Single(model); 67ParameterType = typeof(List<IFormCollection>) 83var model = Assert.IsType<List<IFormCollection>>(modelBindingResult.Model); 84var formCollection = Assert.Single(model); 105ParameterType = typeof(List<IFormCollection>) 122var model = Assert.IsType<List<IFormCollection>>(modelBindingResult.Model);
Microsoft.AspNetCore.Mvc.Test (2)
MvcOptionsSetupTest.cs (2)
187Assert.Equal(typeof(IFormCollection), formCollectionParameter.Type); 250Assert.Equal(typeof(IFormCollection), excludeFilter.Type);
Microsoft.AspNetCore.Routing.FunctionalTests (4)
MinimalFormTests.cs (4)
87var form = await context.Request.ReadFormAsync(); 349var form = await context.Request.ReadFormAsync(); 363var form = context.Request.Form; 377var form = context.Features.Get<IFormFeature>()?.ReadForm();
Microsoft.AspNetCore.Routing.Tests (4)
EndpointRoutingMiddlewareFormOptionsTest.cs (4)
44var _ = httpContext.Request.Form; // Trigger the form feature. 78var _ = httpContext.Request.Form; // Trigger the form feature. 116var _ = httpContext.Request.Form; // Trigger the form feature. 152var _ = httpContext.Request.Form; // Trigger the form feature.
MinimalFormSample (1)
Program.cs (1)
56var form = await context.Request.ReadFormAsync();