2013-09-02 15:40:14 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2015-10-06 17:19:08 +02:00
|
|
|
|
using System.ComponentModel;
|
2013-09-02 15:40:14 +02:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Umbraco.Core.Models.Validation;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Models.ContentEditing
|
|
|
|
|
|
{
|
|
|
|
|
|
[DataContract(Name = "entity", Namespace = "")]
|
|
|
|
|
|
public class EntityBasic
|
|
|
|
|
|
{
|
2013-10-29 11:39:34 +11:00
|
|
|
|
public EntityBasic()
|
|
|
|
|
|
{
|
|
|
|
|
|
AdditionalData = new Dictionary<string, object>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-09-02 15:40:14 +02:00
|
|
|
|
[DataMember(Name = "name", IsRequired = true)]
|
|
|
|
|
|
[RequiredForPersistence(AllowEmptyStrings = false, ErrorMessage = "Required")]
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "id", IsRequired = true)]
|
|
|
|
|
|
[Required]
|
2013-09-27 16:59:38 +10:00
|
|
|
|
public object Id { get; set; }
|
2013-09-02 15:40:14 +02:00
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "icon")]
|
|
|
|
|
|
public string Icon { get; set; }
|
|
|
|
|
|
|
2014-10-02 19:55:24 +10:00
|
|
|
|
[DataMember(Name = "trashed")]
|
2015-10-06 17:19:08 +02:00
|
|
|
|
[ReadOnly(true)]
|
2014-10-02 19:55:24 +10:00
|
|
|
|
public bool Trashed { get; set; }
|
|
|
|
|
|
|
2013-10-11 12:25:10 +11:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This is the unique Id stored in the database - but could also be the unique id for a custom membership provider
|
|
|
|
|
|
/// </summary>
|
2013-10-10 13:33:25 +02:00
|
|
|
|
[DataMember(Name = "key")]
|
|
|
|
|
|
public Guid Key { get; set; }
|
|
|
|
|
|
|
2013-09-02 15:40:14 +02:00
|
|
|
|
[DataMember(Name = "parentId", IsRequired = true)]
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public int ParentId { get; set; }
|
2013-09-03 13:59:25 +10:00
|
|
|
|
|
2013-09-20 14:24:39 +10:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This will only be populated for some entities like macros
|
|
|
|
|
|
/// </summary>
|
2015-10-06 17:19:08 +02:00
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// This is overrideable to specify different validation attributes if required
|
|
|
|
|
|
/// </remarks>
|
2013-09-20 14:24:39 +10:00
|
|
|
|
[DataMember(Name = "alias")]
|
2015-10-06 17:19:08 +02:00
|
|
|
|
public virtual string Alias { get; set; }
|
2013-09-20 14:24:39 +10:00
|
|
|
|
|
2013-09-03 13:59:25 +10:00
|
|
|
|
/// <summary>
|
2013-10-16 10:37:45 +11:00
|
|
|
|
/// The path of the entity
|
2013-09-03 13:59:25 +10:00
|
|
|
|
/// </summary>
|
2013-10-16 10:37:45 +11:00
|
|
|
|
[DataMember(Name = "path")]
|
2013-09-03 16:35:36 +10:00
|
|
|
|
public string Path { get; set; }
|
2013-10-29 11:39:34 +11:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// A collection of extra data that is available for this specific entity/entity type
|
|
|
|
|
|
/// </summary>
|
2013-11-12 12:30:10 +11:00
|
|
|
|
[DataMember(Name = "metaData")]
|
2015-10-06 17:19:08 +02:00
|
|
|
|
[ReadOnly(true)]
|
2013-10-29 11:39:34 +11:00
|
|
|
|
public IDictionary<string, object> AdditionalData { get; private set; }
|
2013-09-02 15:40:14 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|