How to create breadcrumbs using the Dynamic Data / LINQTOSQL infrastructure?

I need some EXAMPLES and IDEAS on how to create a dynamic palette control that will be dynamically created using a dynamic date palette based on LINQTOSQL

+3
source share
2 answers

You will probably need three things:

* , - , , - - , SQL2008, HierarchyId .

, , , , .

, , , :

/// <summary>
/// Gets this SiteMaps children.
/// </summary>
/// <value>The children.</value>
public List<SiteMap> Children {
  get {
    if (null == m_Children && !m_AttemptedToLoadChildren) {
      m_AttemptedToLoadChildren = true;

      m_Children = ctx.GetSiteMapChildrenByPath(_Path, 1).ToList();

      // Sorts ascending.
      m_Children.Sort(( sm1, sm2 ) => sm1.SortOrder.CompareTo(sm2.SortOrder));
      // CMS Sorts Descending, so reverse the list.
      m_Children.Reverse();
    }

    return m_Children;
  }
}

/// <summary>
/// Gets a value indicating whether this instance has any children.
/// </summary>
/// <value>
///  <c>true</c> if this instance has children; otherwise, <c>false</c>.
/// </value>
public bool HasChildren {
  get {
    if (null != Children && Children.Any()) {
      m_HasChildren = true;
    }

    return m_HasChildren;
  }
}

/// <summary>
/// Gets this SiteMaps parent.
/// </summary>
/// <value>The parent.</value>
public SiteMap Parent {
  get {
    if (null == m_Parent && null != _ParentId) {
      m_Parent = ctx.GetSiteMap(_ParentId);
    }

    return m_Parent;
  }
}

GetSiteMap GetSiteMapChildrenByPath procs , LINQ .

+1

, SitMapProvider

Sitemap DD.

0

Source: https://habr.com/ru/post/1730598/


All Articles