| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- commit cbed7393a21483cf25cda77dea8b7cda2b51751f
- Author: Roma Marusyk <[email protected]>
- Date: Thu Sep 27 19:53:39 2018 +0300
- Add XML documentation for IFormFileCollection. #3528 (#1040)
- diff --git a/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs b/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs
- index e66c96e05dd..b7ec5f0af87 100644
- --- a/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs
- +++ b/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs
- @@ -10,10 +10,33 @@ namespace Microsoft.AspNetCore.Http
- /// </summary>
- public interface IFormFileCollection : IReadOnlyList<IFormFile>
- {
- + /// <summary>
- + /// Gets the file with the specified name.
- + /// </summary>
- + /// <param name="name">The name of the file to get.</param>
- + /// <returns>
- + /// The requested file, or null if it is not present.
- + /// </returns>
- IFormFile this[string name] { get; }
-
- + /// <summary>
- + /// Gets the file with the specified name.
- + /// </summary>
- + /// <param name="name">The name of the file to get.</param>
- + /// <returns>
- + /// The requested file, or null if it is not present.
- + /// </returns>
- IFormFile GetFile(string name);
-
- + /// <summary>
- + /// Gets an <see cref="IReadOnlyList{T}" /> containing the files of the
- + /// <see cref="IFormFileCollection" /> with the specified name.
- + /// </summary>
- + /// <param name="name">The name of the files to get.</param>
- + /// <returns>
- + /// An <see cref="IReadOnlyList{T}" /> containing the files of the object
- + /// that implements <see cref="IFormFileCollection" />.
- + /// </returns>
- IReadOnlyList<IFormFile> GetFiles(string name);
- }
- }
- \ No newline at end of file
- diff --git a/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs b/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs
- index 806e756a8e0..bb13e121b2c 100644
- --- a/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs
- +++ b/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs
- @@ -6,10 +6,15 @@ using System.Collections.Generic;
-
- namespace Microsoft.AspNetCore.Http.Internal
- {
- + /// <summary>
- + /// Default implementation of <see cref="IFormFileCollection"/>.
- + /// </summary>
- public class FormFileCollection : List<IFormFile>, IFormFileCollection
- {
- + /// <inheritdoc />
- public IFormFile this[string name] => GetFile(name);
-
- + /// <inheritdoc />
- public IFormFile GetFile(string name)
- {
- foreach (var file in this)
- @@ -23,6 +28,7 @@ namespace Microsoft.AspNetCore.Http.Internal
- return null;
- }
-
- + /// <inheritdoc />
- public IReadOnlyList<IFormFile> GetFiles(string name)
- {
- var files = new List<IFormFile>();
|