Updes more code for U4-337

This commit is contained in:
Shannon
2015-01-06 15:36:14 +11:00
parent f6cd597841
commit 89b8fe93b7
7 changed files with 153 additions and 25 deletions

View File

@@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Web.Models.ContentEditing
{
[DataContract(Name = "relation", Namespace = "")]
public class Relation
{
public Relation()
{
RelationType = new RelationType();
}
/// <summary>
/// Gets or sets the Parent Id of the Relation (Source)
/// </summary>
[DataMember(Name = "parentId")]
public int ParentId { get; set; }
/// <summary>
/// Gets or sets the Child Id of the Relation (Destination)
/// </summary>
[DataMember(Name = "childId")]
public int ChildId { get; set; }
/// <summary>
/// Gets or sets the <see cref="RelationType"/> for the Relation
/// </summary>
[DataMember(Name = "relationType", IsRequired = true)]
public RelationType RelationType { get; set; }
/// <summary>
/// Gets or sets a comment for the Relation
/// </summary>
[DataMember(Name = "comment")]
public string Comment { get; set; }
}
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
[DataContract(Name = "relationType", Namespace = "")]
public class RelationType
{
/// <summary>
/// Gets or sets the Name of the RelationType
/// </summary>
[DataMember(Name = "name", IsRequired = true)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the Alias of the RelationType
/// </summary>
[DataMember(Name = "alias", IsRequired = true)]
public string Alias { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the RelationType is Bidirectional (true) or Parent to Child (false)
/// </summary>
[DataMember(Name = "isBidirectional", IsRequired = true)]
public bool IsBidirectional { get; set; }
/// <summary>
/// Gets or sets the Parents object type id
/// </summary>
/// <remarks>Corresponds to the NodeObjectType in the umbracoNode table</remarks>
[DataMember(Name = "parentObjectType", IsRequired = true)]
public Guid ParentObjectType { get; set; }
/// <summary>
/// Gets or sets the Childs object type id
/// </summary>
/// <remarks>Corresponds to the NodeObjectType in the umbracoNode table</remarks>
[DataMember(Name = "childObjectType", IsRequired = true)]
public Guid ChildObjectType { get; set; }
}
}