Merge pull request #56 from hishamco/dev

Using 'nameof' operator instead of magic strings
This commit is contained in:
Eilon Lipton 2015-05-03 20:42:32 -07:00
commit d936c2d424
5 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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

View File

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