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
103
13.3k
Set Pagination in c#.
Jun 2 2021 7:31 AM
Hello everyone how to implement Pagination in c# code .This is my code please let me know how to implement
var blogPosts = new List<BlogPostSummary>(customEntityResult.Items.Count());
foreach (var customEntity in customEntityResult.Items)
{
var model = (BlogPostDataModel)customEntity.Model;
var blogPost = new BlogPostSummary();
blogPost.Title = customEntity.Title;
blogPost.ShortDescription = model.ShortDescription;
DateTime tempDate = customEntity.CreateDate;
blogPost.PostDate = tempDate.ToString("MMMM dd, yyyy");
blogPost.FullPath = customEntity.PageUrls.FirstOrDefault();
blogPost.CategoryId = model.CategoryIds.SingleOrDefault();
blogPosts.Add(blogPost);
}
TempData["blogPostUrl"] = JsonConvert.SerializeObject(blogPosts);
return customEntityResult.ChangeType(blogPosts);
Reply
Answers (
3
)
.NetCore facing conflicts while editing
How to read JSON data in c# code.