@model IEnumerable @{ ViewBag.Title = "Blogs, l'index"; // Pagination reflects the Index(string id, int skip, int take) // call profile. The service applies Skip/Take server-side, so // the view only needs the current page params to build Prev/Next // links — it does not receive a total count. int currentSkip = Context.Request.Query.TryGetValue("skip", out var skipVal) && int.TryParse(skipVal, out var s) ? s : 0; int currentTake = Context.Request.Query.TryGetValue("take", out var takeVal) && int.TryParse(takeVal, out var t) ? t : 25; var posts = Model.ToList(); bool hasPrev = currentSkip > 0; bool hasNext = posts.Count >= currentTake; int prevSkip = Math.Max(0, currentSkip - currentTake); int nextSkip = currentSkip + currentTake; int maxSummaryLen = 256; } @section header { }

@ViewBag.Title

@ViewBag.StatusMessage

@if (!posts.Any()) {

Néant

} else {
@foreach (var post in posts) { var canEdit = (await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded;
@if (!string.IsNullOrEmpty(post.Photo)) { @post.Title }

@post.Title

@post.Article
Details @if (canEdit) { Delete }
}
}