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

Commit d936c2d

Browse files
committed
Merge pull request #56 from hishamco/dev
Using 'nameof' operator instead of magic strings
2 parents 3bef0fd + 738c6ad commit d936c2d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ public FileExtensionContentTypeProvider(IDictionary<string, string> mapping)
404404
{
405405
if (mapping == null)
406406
{
407-
throw new ArgumentNullException("mapping");
407+
throw new ArgumentNullException(nameof(mapping));
408408
}
409409
Mappings = mapping;
410410
}

src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuild
5656
{
5757
if (options == null)
5858
{
59-
throw new ArgumentNullException("options");
59+
throw new ArgumentNullException(nameof(options));
6060
}
6161

6262
if (options.EnableDefaultFiles)

src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public virtual Task GenerateContentAsync(HttpContext context, IEnumerable<IFileI
2929
{
3030
if (context == null)
3131
{
32-
throw new ArgumentNullException("context");
32+
throw new ArgumentNullException(nameof(context));
3333
}
3434
if (contents == null)
3535
{
36-
throw new ArgumentNullException("contents");
36+
throw new ArgumentNullException(nameof(contents));
3737
}
3838

3939
if (_htmlEncoder == null)

src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected SharedOptionsBase(SharedOptions sharedOptions)
2222
{
2323
if (sharedOptions == null)
2424
{
25-
throw new ArgumentNullException("sharedOptions");
25+
throw new ArgumentNullException(nameof(sharedOptions));
2626
}
2727

2828
SharedOptions = sharedOptions;

src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public async Task SendFileAsync(string fileName, long offset, long? length, Canc
6363

6464
if (string.IsNullOrWhiteSpace(fileName))
6565
{
66-
throw new ArgumentNullException("fileName");
66+
throw new ArgumentNullException(nameof(fileName));
6767
}
6868
if (!File.Exists(fileName))
6969
{

0 commit comments

Comments
 (0)