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
Sunny Dhiman
NA
81
6k
set record in tempdata
May 12 2021 10:27 AM
I have use this code set record in TempData .But Here CategoryId Multiple time for e.g 261 id 3 time but i want to add this id only one time like 261 one time
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();
blogPost.PostDate = customEntity.CreateDate;
blogPost.CategoryId = model.CategoryIds.Distinct().SingleOrDefault();
blogPosts.Add(blogPost);
}
TempData["blogPostUrl"] = JsonConvert.SerializeObject(blogPosts);
Reply
Answers (
1
)
How to Display login User Detail after Login
XMPP client implementation