#3642 - use nameof instead of magic strings that has to be equal to variable name

This commit is contained in:
Bjarke Berg
2019-01-10 07:03:08 +01:00
parent 8594af3fe3
commit 7421378330

View File

@@ -516,17 +516,13 @@ namespace Umbraco.Web.Editors
public SimpleNotificationModel CreateBlueprintFromContent([FromUri]int contentId, [FromUri]string name)
{
if (string.IsNullOrWhiteSpace(name))
{
throw new ArgumentException("Value cannot be null or whitespace.", "name");
}
throw new ArgumentException("Value cannot be null or whitespace.", nameof(name));
var content = Services.ContentService.GetById(contentId);
if (content == null)
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
}
EnsureUniqueName(name, content, "name");
EnsureUniqueName(name, content, nameof(name));
var blueprint = Services.ContentService.CreateContentFromBlueprint(content, name, Security.GetUserId().ResultOr(0));