using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Services_Website.Models;
using Microsoft.AspNetCore.Mvc;
using Services_Website.Data;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
namespace Services_Website.CustomFunctions
{
public class CustomUserOperations: Controller
{
private UserManager<ApplicationUser> _userManager;
public ApplicationUser GetCurrentUser()
{
ClaimsPrincipal currentUser = User;
_userManager = new UserManager<ApplicationUser>();
var user =_userManager.GetUserAsync(User).Result;
return user;
}
}
}
* This is my Controller *
I Just want to get an object of the UserManager Class But when I do it I am getting this ERROR
Error CS7036 There is no argument given that corresponds to the required formal parameter 'store' of 'UserManager.UserManager(IUserStore, IOptions, IPasswordHasher, IEnumerable>, IEnumerable>, ILookupNormalizer, IdentityErrorDescriber, IServiceProvider, ILogger>)' Services_Website F:\webApplication\CoreApp\Services_Website\Services_Website\CustomFunctions\CustomUserOperations.cs 75 Active *
*What is the Error source