Beispiel #1
0
 /// <summary>
 /// Returns an array of redirects where the destination matches the specified <paramref name="nodeType"/> and <paramref name="nodeKey"/>.
 /// </summary>
 /// <param name="nodeType">The type of the destination node.</param>
 /// <param name="nodeKey">The key (GUID) of the destination node.</param>
 /// <returns>An array of <see cref="IRedirect"/>.</returns>
 public virtual IRedirect[] GetRedirectsByNodeKey(RedirectDestinationType nodeType, Guid nodeKey)
 {
     if (nodeType == RedirectDestinationType.Url)
     {
         throw new RedirectsException($"Unsupported node type: {nodeType}");
     }
     return(GetRedirectsByNodeKey(nodeType.ToString(), nodeKey));
 }
 private RedirectDestination(JObject json)
 {
     Id       = json.GetInt32("id");
     Key      = json.GetGuid("key");
     Url      = json.GetString("url");
     Name     = json.GetString("name");
     Query    = json.GetString("query") ?? string.Empty;
     Fragment = json.GetString("fragment") ?? string.Empty;
     Type     = json.GetEnum("type", RedirectDestinationType.Url);
 }