0

enter image description here

In account controller need to check whether user is admin or not using custom property isadmin in bearer token authentication using dot net webapi.

public bool Isadmin(string username,string password)
{
    ApplicationDbContext db = new ApplicationDbContext();
    //or default        
}
Yong Shun
  • 35,286
  • 4
  • 24
  • 46
  • 1
    Have you import [Linq namespace](https://learn.microsoft.com/en-us/dotnet/api/system.linq?view=net-5.0) by `using System.Linq`? – Yong Shun May 27 '21 at 04:44
  • 1
    Thanks i miss namespace problem solved. – Sumeet Bhati May 27 '21 at 04:46
  • 1
    Note that you can click on a type name and press `Ctrl` + `.` on your keyboard (or right-click and select "Quick actions and refactoring") and it will prompt you to add the appropriate `using`. – ProgrammingLlama May 27 '21 at 04:50

0 Answers0