Example #1
0
        public GetSitemapsResponse Get(GetSitemapsRequest request)
        {
            request.Data.SetDefaultOrder("Title");

            var query = repository
                        .AsQueryable <Module.Pages.Models.Sitemap>();

            query = query.ApplySitemapTagsFilter(request.Data);

            var listResponse = query
                               .Where(map => !map.IsDeleted)
                               .Select(map => new SitemapModel
            {
                Id             = map.Id,
                Version        = map.Version,
                CreatedBy      = map.CreatedByUser,
                CreatedOn      = map.CreatedOn,
                LastModifiedBy = map.ModifiedByUser,
                LastModifiedOn = map.ModifiedOn,

                Title = map.Title
            }).ToDataListResponse(request);

            if (listResponse.Items.Count > 0 && request.Data.IncludeTags)
            {
                LoadTags(listResponse, request.Data.IncludeTags);
            }

            return(new GetSitemapsResponse
            {
                Data = listResponse
            });
        }
        public GetSitemapsResponse Get(GetSitemapsRequest request)
        {
            request.Data.SetDefaultOrder("Title");

            var query = repository
                .AsQueryable<Module.Pages.Models.Sitemap>();

            query = query.ApplySitemapTagsFilter(request.Data);

            var listResponse = query
                .Where(map => !map.IsDeleted)
                .Select(map => new SitemapModel
                {
                    Id = map.Id,
                    Version = map.Version,
                    CreatedBy = map.CreatedByUser,
                    CreatedOn = map.CreatedOn,
                    LastModifiedBy = map.ModifiedByUser,
                    LastModifiedOn = map.ModifiedOn,

                    Title = map.Title
                }).ToDataListResponse(request);

            if (listResponse.Items.Count > 0 && request.Data.IncludeTags)
            {
                LoadTags(listResponse, request.Data.IncludeTags);
            }

            return new GetSitemapsResponse
            {
                Data = listResponse
            };
        }