files tree made better.
This commit is contained in:
parent
ffbf032480
commit
ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions
20
src/Yavsc/ViewComponents/CommentViewComponent.cs
Normal file
20
src/Yavsc/ViewComponents/CommentViewComponent.cs
Normal 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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue