2018-11-09 16:12:08 +11:00
using System ;
using System.Collections.Generic ;
2018-07-19 19:32:07 +10:00
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 ; }
2018-08-06 18:05:04 +10:00
/// <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 ; }
2018-07-19 19:32:07 +10:00
/// <summary>
2018-08-14 20:21:33 +10:00
/// Indicates if the variant should be published
2018-07-19 19:32:07 +10:00
/// </summary>
2018-08-06 18:05:04 +10:00
/// <remarks>
2018-08-14 20:21:33 +10:00
/// This option will have no affect if <see cref="Save"/> is false.
/// This is not used to unpublish.
2018-08-06 18:05:04 +10:00
/// </remarks>
2018-07-19 19:32:07 +10:00
[DataMember(Name = "publish")]
public bool Publish { get ; set ; }
2018-11-09 16:12:08 +11:00
[DataMember(Name = "expireDate")]
public DateTime ? ExpireDate { get ; set ; }
[DataMember(Name = "releaseDate")]
public DateTime ? ReleaseDate { get ; set ; }
2018-08-01 16:46:13 +10:00
/// <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 ; }
2018-07-19 19:32:07 +10:00
}
}