using System; 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)] internal 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 ArgumentException("Argument cannot be null nor empty.", "contentTypeAlias"); ContentTypeAlias = contentTypeAlias; } /// /// Gets or sets the content type alias. /// public string ContentTypeAlias { get; private set; } } }