I have custom MemberShip. I want in controller to know , who is current user. What I need to add, that show current user?
[BasicHttpAuthorize]
public class TestController : ApiController
{
public String Get()
{
String memb = CustomMembershipProvider.Current.ToString();
return "Hello " + memb + " From Test Controller!";
}
}
Unfortunately I do not use login by Windows. So I can't use this method. I need to write a method that through the Entity Framework connects to my database. I can not understand where I can save the current user, which would be in the method of Membership.GetUser () to pull out the current user.