Save
1
2
3
public void Save()
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
// Update a value.
node.Slug = "iron-man";
try
{
// Save the changes.
node.Save();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(ValidationException valEx)
{
// Handle data validation errors.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
SaveAsync
1
2
3
public async Task SaveAsync()
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
// Update a value.
node.Slug = "iron-man";
try
{
// Save the changes asynchronously.
await node.SaveAsnyc();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(ValidationException valEx)
{
// Handle data validation errors.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
Delete
1
2
3
public void Delete()
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Delete the node instance.
node.Delete();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
DeleteAsync
1
2
3
public async Task DeleteAsync()
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Delete the node instance.
await node.DeleteAsync();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
NewChild
1
2
3
public Node NewChild(LocalizedString displayName)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Create a new node instance from an existing parent.
var childNode = node.NewChild("Batman Returns");
// Set some additional properties.
childNode.Slug = "batman-returns";
childNode.EntryId = Guid.Parse("f91e37bd-0cf4-4631-b22a-eb0b78841f23");
// Commit the newly created child node.
childNode.Save();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
NewChild with id
1
2
3
public Node NewChild(LocalizedString displayName, Guid id)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Create a new node instance from an existing parent.
var childNode = node.NewChild("Batman Returns", nodeGuid);
// Set some additional properties.
childNode.Slug = "batman-returns";
childNode.EntryId = Guid.Parse("f91e37bd-0cf4-4631-b22a-eb0b78841f23");
// Commit the newly created child node.
childNode.Save();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
Children
1
2
3
public List<Node> Children(string languageOrder = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the child nodes in the order specified for french.
var childNodes = node.Children("fr-FR");
foreach(var child in childNodes)
{
// perform actions on the child nodes.
}
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
ChildrenAsync
1
2
3
public async Task<List<Node>> ChildrenAsync(string languageOrder = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the child nodes for the node.
var childNodes = await node.ChildrenAsync();
foreach(var child in childNodes)
{
// perform actions on the child nodes.
}
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
Parent
1
2
3
public Node Parent()
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the parent node for the node.
var parent = node.Parent();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
ParentAsync
1
2
3
public async Task<Node> ParentAsync()
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the parent node for the node.
var parent = await node.ParentAsync();
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
SetChildNodeOrder with Guid ids
1
2
3
public void SetChildNodeOrder(IEnumerable<Guid> childOrder, string language = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the child nodes for the node.
var childNodes = node.Children();
// Order the nodes by the French display name in a descending order and select the ids.
var orderedNodeIds = childNodes.OrderByDescending(c => c.DisplayName["fr-FR"]).Select(c => c.Id.Value);
// Set the node order for French.
nodes.SetChildNodeOrder(orderedNodeIds, "fr-FR");
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
SetChildNodeOrderAsync with Guid ids
1
2
3
public async Task SetChildNodeOrderAsync(IEnumerable<Guid> childOrder, string language = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the child nodes for the node.
var childNodes = await node.ChildrenAsync();
// Order the nodes by the French display name in a descending order and select the ids.
var orderedNodeIds = childNodes.OrderByDescending(c => c.DisplayName["fr-FR"]).Select(c => c.Id.Value);
// Set the node order for French.
await nodes.SetChildNodeOrderAsync(orderedNodeIds, "fr-FR");
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
SetChildNodeOrder with nodes
1
2
3
public void SetChildNodeOrder(IEnumerable<Node> childOrder, string language = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the child nodes for the node.
var childNodes = node.Children();
// Order the nodes by the French display name in a descending order.
var orderedNodes = childNodes.OrderByDescending(c => c.DisplayName["fr-FR"]);
// Set the node order for French.
nodes.SetChildNodeOrder(orderedNodes, "fr-FR");
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
SetChildNodeOrderAsync with nodes
1
2
3
public async Task SetChildNodeOrderAsync(IEnumerable<Node> childOrder, string language = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Get the child nodes for the node.
var childNodes = await node.ChildrenAsync();
// Order the nodes by the French display name in a descending order.
var orderedNode = childNodes.OrderByDescending(c => c.DisplayName["fr-FR"]);
// Set the node order for French.
await nodes.SetChildNodeOrderAsync(orderedNode, "fr-FR");
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
DeleteChildNodeOrder
1
2
3
public void DeleteChildNodeOrder(string language = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Delete the default node order.
nodes.DeleteChildNodeOrder();
// Delete the node order for German.
nodes.DeleteChildNodeOrder("de-DE");
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}
DeleteChildNodeOrderAsync
1
2
3
public async Task DeleteChildNodeOrderAsync(string language = null)
{
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Get a node.
var node = client.Nodes.Get("1abf0e7f-7507-4578-a3be-1280ed7486fe");
try
{
// Delete the default node order.
await nodes.DeleteChildNodeOrderAsync();
// Delete the node order for German.
await nodes.DeleteChildNodeOrderAsync("de-DE");
}
catch(RestRequestException restEx)
{
// Handle service error.
}
catch(Exception ex)
{
// Handle anything else, e.g. network error.
}