Add project files.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using ConstructorApp.DataAccessLayer.Concrete;
|
||||
using ConstructorApp.EntityLayer.Entities;
|
||||
using ConstructorAppUI.ViewModels;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.AdminLayoutComponents
|
||||
{
|
||||
public class _AdminLayoutNavbarPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly string _signalRHubBaseUrl;
|
||||
private readonly ConstructorContext _context;
|
||||
private readonly UserManager<AppUser> _userManager;
|
||||
|
||||
public _AdminLayoutNavbarPartialComponent(IConfiguration configuration, ConstructorContext context, UserManager<AppUser> userManager)
|
||||
{
|
||||
_signalRHubBaseUrl = configuration["SignalRHubSettings:BaseUrl"];
|
||||
_context = context;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
ViewBag.SignalRHubBaseUrl = _signalRHubBaseUrl;
|
||||
var user = await _userManager.GetUserAsync(HttpContext.User);
|
||||
var model = new UserProfileViewModel
|
||||
{
|
||||
UserName = user.UserName
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user