strong ressources and interface
This commit is contained in:
parent
556d5b6ad2
commit
ddedb227b1
44 changed files with 2456 additions and 414 deletions
|
|
@ -18,11 +18,11 @@ namespace Yavsc.ViewComponents
|
|||
{
|
||||
ApplicationDbContext dbContext;
|
||||
IBillingService billing;
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer;
|
||||
IStringLocalizer<Yavsc.YavscLocalisation> localizer;
|
||||
ILogger logger ;
|
||||
|
||||
public BillViewComponent(ApplicationDbContext dbContext,
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
|
||||
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
|
||||
IBillingService billing,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,15 +4,17 @@ using Yavsc.Models.Blog;
|
|||
|
||||
namespace Yavsc.ViewComponents
|
||||
{
|
||||
public class CommentViewComponent : ViewComponent
|
||||
public partial class CommentViewComponent : ViewComponent
|
||||
{
|
||||
IStringLocalizer<CommentViewComponent> localizer;
|
||||
public CommentViewComponent(IStringLocalizer<CommentViewComponent> localizer)
|
||||
{
|
||||
this.localizer = localizer;
|
||||
|
||||
}
|
||||
public IViewComponentResult Invoke(IIdentified<long> longCommentable)
|
||||
{
|
||||
// for a BlogPost, it results in the localization 'apiRouteCommentBlogPost': blogcomments
|
||||
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