-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from contentful/feature/add-reference-type
Feature/add reference type
- Loading branch information
Showing
4 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Contentful.Core.Models.Management | ||
{ | ||
/// <summary> | ||
/// Represents a reference link returned from the Contentful API. | ||
/// Allows you to easily model reference fields when creating new entries. | ||
/// </summary> | ||
public class Reference | ||
{ | ||
/// <summary> | ||
/// The properties for this reference. | ||
/// </summary> | ||
public ReferenceProperties Sys { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// Encapsulates the three properties that a <see cref="Reference"/> consists of. | ||
/// </summary> | ||
public class ReferenceProperties | ||
{ | ||
/// <summary> | ||
/// The type of object, for references this is always "Link". | ||
/// </summary> | ||
public string Type => "Link"; | ||
|
||
/// <summary> | ||
/// The type of link. Normally one of <see cref="SystemLinkTypes"/>. | ||
/// </summary> | ||
public string LinkType { get; set; } | ||
|
||
/// <summary> | ||
/// The if of the item which is being referenced. | ||
/// </summary> | ||
public string Id { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters