I want administrators on my site to be capable of locking members out, but the IsLockedOut() for the default mvc membership is readonly. I read that I need to create a custom membership provider, but I am not entirely sure what that means. Do I need to create a new model with a membershipUser property? If possible, I don't want to create a new table in the database.
Here is the code that I have for my lockUser method:
public static void LockUser(this MembershipUser user)
{
using (var db = new MovieContext())
{
Guid userid = (Guid)user.ProviderUserKey;
MembershipUser member = Membership.GetUser(userid);
member.IsLockedOut = true;
member.LastLockoutDate = DateTime.Now;
db.SaveChanges();
}
}