Using 'nameof' operator instead of magic strings

This commit is contained in:
Hisham Abdullah Bin Ateya 2015-05-03 13:57:45 +03:00
parent 3bef0fd817
commit 738c6ad0ff
5 changed files with 6 additions and 6 deletions

View File

@ -404,7 +404,7 @@ namespace Microsoft.AspNet.StaticFiles
{
if (mapping == null)
{
throw new ArgumentNullException("mapping");
throw new ArgumentNullException(nameof(mapping));
}
Mappings = mapping;
}

View File

@ -56,7 +56,7 @@ namespace Microsoft.AspNet.Builder
{
if (options == null)
{
throw new ArgumentNullException("options");
throw new ArgumentNullException(nameof(options));
}
if (options.EnableDefaultFiles)

View File

@ -29,11 +29,11 @@ namespace Microsoft.AspNet.StaticFiles
{
if (context == null)
{
throw new ArgumentNullException("context");
throw new ArgumentNullException(nameof(context));
}
if (contents == null)
{
throw new ArgumentNullException("contents");
throw new ArgumentNullException(nameof(contents));
}
if (_htmlEncoder == null)

View File

@ -22,7 +22,7 @@ namespace Microsoft.AspNet.StaticFiles.Infrastructure
{
if (sharedOptions == null)
{
throw new ArgumentNullException("sharedOptions");
throw new ArgumentNullException(nameof(sharedOptions));
}
SharedOptions = sharedOptions;

View File

@ -63,7 +63,7 @@ namespace Microsoft.AspNet.StaticFiles
if (string.IsNullOrWhiteSpace(fileName))
{
throw new ArgumentNullException("fileName");
throw new ArgumentNullException(nameof(fileName));
}
if (!File.Exists(fileName))
{