Use c#9 + namespace fix
This commit is contained in:
23
src/Umbraco.Web.UI.NetCore/BergViewComponent.cs
Normal file
23
src/Umbraco.Web.UI.NetCore/BergViewComponent.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
|
||||
namespace Umbraco.Cms.Web.UI.NetCore
|
||||
{
|
||||
public class BergViewComponent : ViewComponent
|
||||
{
|
||||
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
|
||||
|
||||
public BergViewComponent(IUmbracoContextAccessor umbracoContextAccessor)
|
||||
{
|
||||
_umbracoContextAccessor = umbracoContextAccessor;
|
||||
}
|
||||
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
TempData["BERG"] = "coool";
|
||||
|
||||
var currentPage = _umbracoContextAccessor.UmbracoContext.PublishedRequest?.PublishedContent;
|
||||
return View(currentPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user