TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
4
434
Get Page URL Path
May 5 2021 8:05 AM
Hello everyone i have use this code for get blog post detail
private
async Task<PagedQueryResult<BlogPostSummary>> MapBlogPostsAsync(PagedQueryResult<CustomEntityRenderSummary> customEntityResult)
{
var blogPosts =
new
List<BlogPostSummary>(customEntityResult.Items.Count());
var imageAssetIds = customEntityResult
.Items
.Select(i => (BlogPostDataModel)i.Model)
.Select(m => m.ThumbnailImageAssetId)
.Distinct();
var images = await _imageAssetRepository.GetImageAssetRenderDetailsByIdRangeAsync(imageAssetIds);
foreach
(var customEntity
in
customEntityResult.Items)
{
var model = (BlogPostDataModel)customEntity.Model;
var blogPost =
new
BlogPostSummary();
blogPost.Title = customEntity.Title;
blogPost.ShortDescription = model.ShortDescription;
blogPost.ThumbnailImageAsset = images.GetOrDefault(model.ThumbnailImageAssetId);
blogPost.FullPath = customEntity.PageUrls.FirstOrDefault(); --Here
get
full path of page . it's working fine
But I have use this code for categorypage full path here null value display.
private
ICollection<CategorySummary> MapCategories(PagedQueryResult<CustomEntityRenderSummary> customEntityResult)
{
var categories =
new
List<CategorySummary>(customEntityResult.Items.Count());
foreach
(var customEntity
in
customEntityResult.Items)
{
var model = (CategoryDataModel)customEntity.Model;
var category =
new
CategorySummary();
category.CategoryId = customEntity.CustomEntityId;
category.Title = customEntity.Title;
category.ShortDescription = model.ShortDescription;
category.UrlSlug = customEntity.UrlSlug;
category.FullPath = customEntity.PageUrls.FirstOrDefault();
Please check this .
Reply
Answers (
3
)
how to display username after succcesfully login in asp.net mvc
Send Id .cshtml to .cs page