HttpAbstractions 290 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. commit cbed7393a21483cf25cda77dea8b7cda2b51751f
  2. Author: Roma Marusyk <[email protected]>
  3. Date: Thu Sep 27 19:53:39 2018 +0300
  4. Add XML documentation for IFormFileCollection. #3528 (#1040)
  5. diff --git a/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs b/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs
  6. index e66c96e05dd..b7ec5f0af87 100644
  7. --- a/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs
  8. +++ b/src/Microsoft.AspNetCore.Http.Features/IFormFileCollection.cs
  9. @@ -10,10 +10,33 @@ namespace Microsoft.AspNetCore.Http
  10. /// </summary>
  11. public interface IFormFileCollection : IReadOnlyList<IFormFile>
  12. {
  13. + /// <summary>
  14. + /// Gets the file with the specified name.
  15. + /// </summary>
  16. + /// <param name="name">The name of the file to get.</param>
  17. + /// <returns>
  18. + /// The requested file, or null if it is not present.
  19. + /// </returns>
  20. IFormFile this[string name] { get; }
  21. + /// <summary>
  22. + /// Gets the file with the specified name.
  23. + /// </summary>
  24. + /// <param name="name">The name of the file to get.</param>
  25. + /// <returns>
  26. + /// The requested file, or null if it is not present.
  27. + /// </returns>
  28. IFormFile GetFile(string name);
  29. + /// <summary>
  30. + /// Gets an <see cref="IReadOnlyList{T}" /> containing the files of the
  31. + /// <see cref="IFormFileCollection" /> with the specified name.
  32. + /// </summary>
  33. + /// <param name="name">The name of the files to get.</param>
  34. + /// <returns>
  35. + /// An <see cref="IReadOnlyList{T}" /> containing the files of the object
  36. + /// that implements <see cref="IFormFileCollection" />.
  37. + /// </returns>
  38. IReadOnlyList<IFormFile> GetFiles(string name);
  39. }
  40. }
  41. \ No newline at end of file
  42. diff --git a/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs b/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs
  43. index 806e756a8e0..bb13e121b2c 100644
  44. --- a/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs
  45. +++ b/src/Microsoft.AspNetCore.Http/Internal/FormFileCollection.cs
  46. @@ -6,10 +6,15 @@ using System.Collections.Generic;
  47. namespace Microsoft.AspNetCore.Http.Internal
  48. {
  49. + /// <summary>
  50. + /// Default implementation of <see cref="IFormFileCollection"/>.
  51. + /// </summary>
  52. public class FormFileCollection : List<IFormFile>, IFormFileCollection
  53. {
  54. + /// <inheritdoc />
  55. public IFormFile this[string name] => GetFile(name);
  56. + /// <inheritdoc />
  57. public IFormFile GetFile(string name)
  58. {
  59. foreach (var file in this)
  60. @@ -23,6 +28,7 @@ namespace Microsoft.AspNetCore.Http.Internal
  61. return null;
  62. }
  63. + /// <inheritdoc />
  64. public IReadOnlyList<IFormFile> GetFiles(string name)
  65. {
  66. var files = new List<IFormFile>();