Sdl.Web.Tridion/Providers/ModelService/DefaultModelServiceProvider.cs
/// <summary>
/// Get child site map items.
/// </summary>
Get child site map items.
Get child site map items .
public SitemapItem[] GetChildSitemapItems(string parentSitemapItemId, ILocalization localization,
            bool includeAncestors, int descendantLevels)
        {
            try
            {
                SitemapChildItemModelRequest request = new SitemapChildItemModelRequest
                {
                    PublicationId = int.Parse(localization.Id),
                    ParentSitemapItemId = parentSitemapItemId,
                    IncludeAncestors = includeAncestors,
                    DescendantLevels = descendantLevels,
                    Binder = _binder
                };
                return _modelServiceClient.PerformRequest<SitemapItem[]>(request).Response;
            }
            catch (ModelServiceException e)
            {
                Log.Error("{0} returned an unexpected response for URL '{1}':\n{2} ", ModelServiceName, _modelServiceClient.ModelServiceBaseUri,
                   e.Message);
                throw new DxaException($"{ModelServiceName} returned an unexpected response.", e);
            }
            catch (ItemNotFoundException)
            {
                return null;
            }
        }
public SitemapItem [ ] GetChildSitemapItems ( string parentSitemapItemId , ILocalization localization , bool includeAncestors , int descendantLevels ) { try { SitemapChildItemModelRequest request = new SitemapChildItemModelRequest { PublicationId = int . Parse ( localization . Id ) , ParentSitemapItemId = parentSitemapItemId , IncludeAncestors = includeAncestors , DescendantLevels = descendantLevels , Binder = _binder } ; return _modelServiceClient . PerformRequest < SitemapItem [ ] > ( request ) . Response ; } catch ( ModelServiceException e ) { Log . Error ( " \n " , ModelServiceName , _modelServiceClient . ModelServiceBaseUri , e . Message ) ; throw new DxaException ( $" { ModelServiceName }  returned an unexpected response. " , e ) ; } catch ( ItemNotFoundException ) { return null ; } }
Get child site map items.
Get child site map items .
parentSitemapItemId
string
localization
ILocalization
includeAncestors
bool
descendantLevels
int