Files
Umbraco-CMS/src/Umbraco.Web/Models/ContentEditing/ContentPropertyBase.cs

37 lines
1.0 KiB
C#

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 = "")]
public class ContentPropertyBase
{
[DataMember(Name = "id", IsRequired = true)]
[Required]
public int Id { get; set; }
[DataMember(Name = "value")]
public string Value { get; set; }
protected bool Equals(ContentPropertyBase other)
{
return Id == other.Id;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
var other = obj as ContentPropertyBase;
return other != null && Equals(other);
}
public override int GetHashCode()
{
return Id;
}
}
}