IFormCollection Interface

Represents the parsed form values sent with the HttpRequest.

Namespace
Microsoft.AspNetCore.Http
Assemblies
  • Microsoft.AspNetCore.Http.Features

Syntax

public interface IFormCollection : IEnumerable<KeyValuePair<string, StringValues>>, IEnumerable
interface Microsoft.AspNetCore.Http.IFormCollection

Methods

ContainsKey(System.String)
Determines whether the Microsoft.AspNetCore.Http.IFormCollection contains an element with the specified key.
Arguments:key (System.String) – The key to locate in the Microsoft.AspNetCore.Http.IFormCollection.
Return type:System.Boolean
Returns:true if the Microsoft.AspNetCore.Http.IFormCollection contains an element with the key; otherwise, false.
bool ContainsKey(string key)
TryGetValue(System.String, out Microsoft.Extensions.Primitives.StringValues)
Gets the value associated with the specified key.
Arguments:
  • key (System.String) – The key of the value to get.
  • value (Microsoft.Extensions.Primitives.StringValues) – The key of the value to get. When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
Return type:

System.Boolean

Returns:

true if the object that implements Microsoft.AspNetCore.Http.IFormCollection contains

an element with the specified key; otherwise, false.

bool TryGetValue(string key, out StringValues value)

Properties

Microsoft.AspNetCore.Http.IFormCollection.Count
Gets the number of elements contained in the Microsoft.AspNetCore.Http.IFormCollection.
Return type:System.Int32
Returns:The number of elements contained in the Microsoft.AspNetCore.Http.IFormCollection.
int Count { get; }
Microsoft.AspNetCore.Http.IFormCollection.Files

The file collection sent with the request.

Return type:Microsoft.AspNetCore.Http.IFormFileCollection
Returns:The files included with the request.
IFormFileCollection Files { get; }
Microsoft.AspNetCore.Http.IFormCollection.Item[System.String]
Gets the value with the specified key.
Arguments:key (System.String) – The key of the value to get.
Return type:Microsoft.Extensions.Primitives.StringValues
Returns:The element with the specified key, or <code>StringValues.Empty</code> if the key is not present.
StringValues this[string key] { get; }
Microsoft.AspNetCore.Http.IFormCollection.Keys
Gets an System.Collections.Generic.ICollection`1 containing the keys of the Microsoft.AspNetCore.Http.IFormCollection.
Return type:System.Collections.Generic.ICollection<System.String>
Returns:An System.Collections.Generic.ICollection`1 containing the keys of the object that implements Microsoft.AspNetCore.Http.IFormCollection.
ICollection<string> Keys { get; }