Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 8e6dda3

Browse files
committed
Made CancellationToken optional
1 parent bbf245c commit 8e6dda3

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

src/Microsoft.AspNet.Http.Abstractions/IFormFile.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,11 @@ public interface IFormFile
5353
/// <param name="path">The path of the file to create.</param>
5454
void SaveAs(string path);
5555

56-
/// <summary>
57-
/// Asynchronously saves the contents of the uploaded file.
58-
/// </summary>
59-
/// <param name="path">The path of the file to create.</param>
60-
Task SaveAsAsync(string path);
61-
6256
/// <summary>
6357
/// Asynchronously saves the contents of the uploaded file.
6458
/// </summary>
6559
/// <param name="path">The path of the file to create.</param>
6660
/// <param name="cancellationToken"></param>
67-
Task SaveAsAsync(string path, CancellationToken cancellationToken);
61+
Task SaveAsAsync(string path, CancellationToken cancellationToken = default(CancellationToken));
6862
}
6963
}

src/Microsoft.AspNet.Http/Features/FormFile.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,12 @@ public void SaveAs(string path)
8484
}
8585
}
8686

87-
/// <summary>
88-
/// Asynchronously saves the contents of the uploaded file.
89-
/// </summary>
90-
/// <param name="path">The path of the file to create.</param>
91-
public Task SaveAsAsync(string path)
92-
{
93-
return SaveAsAsync(path, CancellationToken.None);
94-
}
95-
9687
/// <summary>
9788
/// Asynchronously saves the contents of the uploaded file.
9889
/// </summary>
9990
/// <param name="path">The path of the file to create.</param>
10091
/// <param name="cancellationToken"></param>
101-
public async Task SaveAsAsync(string path, CancellationToken cancellationToken)
92+
public async Task SaveAsAsync(string path, CancellationToken cancellationToken = default(CancellationToken))
10293
{
10394
using (var fileStream = File.Create(path, DefaultBufferSize))
10495
{

0 commit comments

Comments
 (0)