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

37 lines
1.0 KiB
C#
Raw Normal View History

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
{
[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)
{
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;
return other != null && Equals(other);
}
public override int GetHashCode()
{
return Id;
}
}
}