a blog index

This commit is contained in:
Paul Schneider 2023-04-01 15:03:48 +01:00
commit 2666492a18
10 changed files with 47 additions and 45 deletions

View file

@ -67,7 +67,7 @@ namespace Yavsc.Controllers
{
string posterId = (await _context.Users.SingleOrDefaultAsync(u=>u.UserName == userName))?.Id ?? null ;
var result = _context.UserPosts(posterId, User.Identity.Name);
return View("Index", result.OrderByDescending(p => p.DateCreated).ToList().Skip(pageLen*pageNum).Take(pageLen).GroupBy(p=> p.Title ));
return View("Index", result.ToArray().Skip(pageLen*pageNum).Take(pageLen).OrderByDescending(p => p.DateCreated).ToList().GroupBy(p=> p.Title ));
}
// GET: Blog/Details/5
[AllowAnonymous]