Utilize nameof operator

This commit is contained in:
Henk Mollema 2015-05-11 17:37:54 +02:00
parent 7dc0508c03
commit 89b5f5b1aa
3 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Razor.Generator
{
if (string.IsNullOrEmpty(className))
{
throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "className");
throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, nameof(className));
}
ClassName = className;

View File

@ -131,8 +131,8 @@ namespace Microsoft.AspNet.Razor
if (change.NewBuffer == null)
{
throw new ArgumentException(RazorResources.FormatStructure_Member_CannotBeNull(
"Buffer",
"TextChange"), "change");
nameof(change.NewBuffer),
nameof(TextChange)), nameof(change));
}
var result = PartialParseResult.Rejected;

View File

@ -100,7 +100,7 @@ namespace Microsoft.AspNet.Razor.Test.Editor
parser.CheckForStructureChanges(change);
}
});
ExceptionHelpers.ValidateArgumentException(parameterName, RazorResources.FormatStructure_Member_CannotBeNull("Buffer", "TextChange"), exception);
ExceptionHelpers.ValidateArgumentException(parameterName, RazorResources.FormatStructure_Member_CannotBeNull(nameof(change.NewBuffer), nameof(TextChange)), exception);
}
private static RazorEngineHost CreateHost()