Add and use ArgumentNullOrEmptyException

This commit is contained in:
Stephan
2016-10-11 15:57:17 +02:00
parent a00ee8d275
commit 187e5ed751
7 changed files with 49 additions and 19 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Umbraco.Core.Exceptions;
namespace Umbraco.Core.Models.PublishedContent
{
@@ -16,8 +17,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <param name="contentTypeAlias">The content type alias.</param>
public PublishedContentModelAttribute(string contentTypeAlias)
{
if (string.IsNullOrWhiteSpace(contentTypeAlias))
throw new ArgumentException("Argument cannot be null nor empty.", "contentTypeAlias");
if (string.IsNullOrWhiteSpace(contentTypeAlias)) throw new ArgumentNullOrEmptyException(nameof(contentTypeAlias));
ContentTypeAlias = contentTypeAlias;
}