hanyadikhetvan-dotnethf/HanyadikHetVan/Areas/Identity/Pages/Account/Manage/PersonalData.cshtml.cs
Torma Kristóf 634488c2d8
All checks were successful
continuous-integration/drone/push Build is passing
addfunfacts
2021-05-19 17:56:56 +02:00

34 lines
991 B
C#

using System.Threading.Tasks;
using HanyadikHetVan.Data.Entities;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace HanyadikHetVan.Areas.Identity.Pages.Account.Manage
{
public class PersonalDataModel : PageModel
{
private readonly UserManager<User> _userManager;
private readonly ILogger<PersonalDataModel> _logger;
public PersonalDataModel(
UserManager<User> userManager,
ILogger<PersonalDataModel> logger)
{
_userManager = userManager;
_logger = logger;
}
public async Task<IActionResult> OnGet()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
return Page();
}
}
}