2013-05-23 22:15:52 -10:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Models.ContentEditing
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents a content property to be saved
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataContract(Name = "property", Namespace = "")]
|
2013-06-10 10:36:59 -02:00
|
|
|
|
public class ContentPropertyBasic
|
2013-05-23 22:15:52 -10:00
|
|
|
|
{
|
|
|
|
|
|
[DataMember(Name = "id", IsRequired = true)]
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember(Name = "value")]
|
|
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
|
|
2013-06-10 10:36:59 -02:00
|
|
|
|
protected bool Equals(ContentPropertyBasic other)
|
2013-05-23 22:15:52 -10:00
|
|
|
|
{
|
|
|
|
|
|
return Id == other.Id;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ReferenceEquals(null, obj)) return false;
|
|
|
|
|
|
if (ReferenceEquals(this, obj)) return true;
|
2013-06-10 10:36:59 -02:00
|
|
|
|
var other = obj as ContentPropertyBasic;
|
2013-05-23 22:15:52 -10:00
|
|
|
|
return other != null && Equals(other);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Id;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|