Merge pull request #56 from hishamco/dev
Using 'nameof' operator instead of magic strings
This commit is contained in:
commit
d936c2d424
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue