no comment

This commit is contained in:
Paul Schneider 2017-10-04 23:53:47 +02:00
commit 0e49b13965
54 changed files with 6158 additions and 213 deletions

View file

@ -0,0 +1,20 @@
using Microsoft.AspNet.Mvc;
using Microsoft.Extensions.Localization;
using Yavsc.Models.Blog;
namespace Yavsc.ViewComponents
{
public class CommentViewComponent : ViewComponent
{
IStringLocalizer<CommentViewComponent> localizer;
public CommentViewComponent(IStringLocalizer<CommentViewComponent> localizer)
{
this.localizer = localizer;
}
public IViewComponentResult Invoke(IIdentified<long> longCommentable)
{
ViewData["apictlr"] = "/api/"+localizer["apiRouteComment"+longCommentable.GetType().Name];
return View(longCommentable.GetType().Name, new Comment{ PostId = longCommentable.Id });
}
}
}