ajout lien vers la page de détail
This commit is contained in:
parent
4e34679168
commit
849d4e2260
@ -4,4 +4,8 @@
|
||||
<h3 class="text-indigo-500 font-semibold text-xl"><a href="@Model.Url">@Model.Url</a></h3>
|
||||
|
||||
<p>@Model.Description</p>
|
||||
|
||||
<div>
|
||||
<a asp-controller="Links" asp-action="Detail" asp-route-id="@Model.Id">Détail du lien</a>
|
||||
</div>
|
||||
</article>
|
||||
@ -21,12 +21,24 @@ public class MemoryLinkRepository : ILinkRepository, IReadStore
|
||||
|
||||
public LinkHomePage[] GetPublishedLinks()
|
||||
{
|
||||
return _links.Select(l => new LinkHomePage
|
||||
{
|
||||
Id = l.Id,
|
||||
Url = l.Url,
|
||||
Description = l.Description,
|
||||
CommentsCount = 0,
|
||||
}).ToArray();
|
||||
// return (from l in _links
|
||||
// orderby l.CreatedAt descending
|
||||
// select new LinkHomePage
|
||||
// {
|
||||
// Id = l.Id,
|
||||
// Url = l.Url,
|
||||
// Description = l.Description,
|
||||
// CommentsCount = 0,
|
||||
// }).ToArray();
|
||||
|
||||
return _links
|
||||
.OrderByDescending(l => l.CreatedAt)
|
||||
.Select(l => new LinkHomePage
|
||||
{
|
||||
Id = l.Id,
|
||||
Url = l.Url,
|
||||
Description = l.Description,
|
||||
CommentsCount = 0,
|
||||
}).ToArray();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user