using System; using System.Collections.Generic; using System.Runtime.Serialization; using Umbraco.Core.Models; using Umbraco.Core.Models.Validation; namespace Umbraco.Web.Models.ContentEditing { [DataContract(Name = "contentVariant", Namespace = "")] public class ContentVariantSave : IContentProperties { public ContentVariantSave() { Properties = new List(); } [DataMember(Name = "name", IsRequired = true)] [RequiredForPersistence(AllowEmptyStrings = false, ErrorMessage = "Required")] public string Name { get; set; } [DataMember(Name = "properties")] public IEnumerable Properties { get; set; } /// /// The culture of this variant, if this is invariant than this is null or empty /// [DataMember(Name = "culture")] public string Culture { get; set; } /// /// Indicates if the variant should be updated /// /// /// If this is false, this variant data will not be updated at all /// [DataMember(Name = "save")] public bool Save { get; set; } /// /// Indicates if the variant should be published /// /// /// This option will have no affect if is false. /// This is not used to unpublish. /// [DataMember(Name = "publish")] public bool Publish { get; set; } [DataMember(Name = "expireDate")] public DateTime? ExpireDate { get; set; } [DataMember(Name = "releaseDate")] public DateTime? ReleaseDate { get; set; } /// /// The property DTO object is used to gather all required property data including data type information etc... for use with validation - used during inbound model binding /// /// /// We basically use this object to hydrate all required data from the database into one object so we can validate everything we need /// instead of having to look up all the data individually. /// This is not used for outgoing model information. /// [IgnoreDataMember] internal ContentPropertyCollectionDto PropertyCollectionDto { get; set; } } }