67 lines
2.4 KiB
C#
67 lines
2.4 KiB
C#
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<ContentPropertyBasic>
|
|
{
|
|
public ContentVariantSave()
|
|
{
|
|
Properties = new List<ContentPropertyBasic>();
|
|
}
|
|
|
|
[DataMember(Name = "name", IsRequired = true)]
|
|
[RequiredForPersistence(AllowEmptyStrings = false, ErrorMessage = "Required")]
|
|
public string Name { get; set; }
|
|
|
|
[DataMember(Name = "properties")]
|
|
public IEnumerable<ContentPropertyBasic> Properties { get; set; }
|
|
|
|
/// <summary>
|
|
/// The culture of this variant, if this is invariant than this is null or empty
|
|
/// </summary>
|
|
[DataMember(Name = "culture")]
|
|
public string Culture { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indicates if the variant should be updated
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// If this is false, this variant data will not be updated at all
|
|
/// </remarks>
|
|
[DataMember(Name = "save")]
|
|
public bool Save { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indicates if the variant should be published
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This option will have no affect if <see cref="Save"/> is false.
|
|
/// This is not used to unpublish.
|
|
/// </remarks>
|
|
[DataMember(Name = "publish")]
|
|
public bool Publish { get; set; }
|
|
|
|
[DataMember(Name = "expireDate")]
|
|
public DateTime? ExpireDate { get; set; }
|
|
|
|
[DataMember(Name = "releaseDate")]
|
|
public DateTime? ReleaseDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 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
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 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.
|
|
/// </remarks>
|
|
[IgnoreDataMember]
|
|
internal ContentPropertyCollectionDto PropertyCollectionDto { get; set; }
|
|
}
|
|
}
|