Utilized `nameof()` for `ArgumentNullException`s
Utilized the use of nameof() operator for ArgumentNullExceptions.
This commit is contained in:
parent
98614736a7
commit
955b45f995
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException(nameof(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
_location = value;
|
_location = value;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException(nameof(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
_fileContents = value;
|
_fileContents = value;
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException(nameof(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
_fileName = value;
|
_fileName = value;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException(nameof(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
_fileStream = value;
|
_fileStream = value;
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,9 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value",
|
throw new ArgumentNullException(nameof(value),
|
||||||
Resources.FormatPropertyOfTypeCannotBeNull(
|
Resources.FormatPropertyOfTypeCannotBeNull(
|
||||||
"CookieName", typeof(AntiForgeryOptions)));
|
nameof(CookieName), typeof(AntiForgeryOptions)));
|
||||||
}
|
}
|
||||||
|
|
||||||
_cookieName = value;
|
_cookieName = value;
|
||||||
|
|
@ -61,9 +61,9 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value",
|
throw new ArgumentNullException(nameof(value),
|
||||||
Resources.FormatPropertyOfTypeCannotBeNull(
|
Resources.FormatPropertyOfTypeCannotBeNull(
|
||||||
"FormFieldName", typeof(AntiForgeryOptions)));
|
nameof(FormFieldName), typeof(AntiForgeryOptions)));
|
||||||
}
|
}
|
||||||
|
|
||||||
_formFieldName = value;
|
_formFieldName = value;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException(nameof(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
base.DisplayName = value;
|
base.DisplayName = value;
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value",
|
throw new ArgumentNullException(nameof(value),
|
||||||
Resources.FormatPropertyOfTypeCannotBeNull("AntiForgeryOptions",
|
Resources.FormatPropertyOfTypeCannotBeNull(nameof(AntiForgeryOptions),
|
||||||
typeof(MvcOptions)));
|
typeof(MvcOptions)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (routeKey == null)
|
if (routeKey == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("routeKey");
|
throw new ArgumentNullException(nameof(routeKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
RouteKey = routeKey;
|
RouteKey = routeKey;
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException(nameof(value));
|
||||||
}
|
}
|
||||||
_innerDictionary[key] = value;
|
_innerDictionary[key] = value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
{
|
{
|
||||||
if (content == null)
|
if (content == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("content");
|
throw new ArgumentNullException(nameof(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
Start = start;
|
Start = start;
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Host.Test
|
||||||
{
|
{
|
||||||
if (content == null)
|
if (content == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("content");
|
throw new ArgumentNullException(nameof(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
Start = start;
|
Start = start;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.TestCommon
|
||||||
{
|
{
|
||||||
if (testDataProvider == null)
|
if (testDataProvider == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("testDataProvider");
|
throw new ArgumentNullException(nameof(testDataProvider));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.testDataProvider = testDataProvider;
|
this.testDataProvider = testDataProvider;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue