using System; using Umbraco.Core.Exceptions; namespace Umbraco.Core.Models.PublishedContent { /// /// /// Indicates that the class is a published content model for a specified content type. /// /// By default, the name of the class is assumed to be the content type alias. The /// PublishedContentModelAttribute can be used to indicate a different alias. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public sealed class PublishedContentModelAttribute : Attribute { /// /// /// Initializes a new instance of the class with a content type alias. /// /// The content type alias. public PublishedContentModelAttribute(string contentTypeAlias) { if (string.IsNullOrWhiteSpace(contentTypeAlias)) throw new ArgumentNullOrEmptyException(nameof(contentTypeAlias)); ContentTypeAlias = contentTypeAlias; } /// /// Gets or sets the content type alias. /// public string ContentTypeAlias { get; } } }