I need some help implementing a custom role provider in a asp.net mvc app.
The problem is that I'm getting several errors like:
MyRoleProvider does not implement inherited abstract member 'System.Web.Security.RoleProvider.RoleExists(string)
I get the same error for other methods. However, I do have implementations for those...
My web.config has this:
<roleManager enabled="true" defaultProvider="MyCustomProvider">
<providers>
<add name="MyCustomProvider" type="MyRoleProvider" />
</providers>
</roleManager>
My custom role provider is like this (I ommited a few of the methods):
public class MyRoleProvider : RoleProvider {
public override string ApplicationName {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
public override bool RoleExists(string roleName)
{
throw new NotImplementedException();
}
public override bool IsUserInRole(string username, string roleName)
return true;
}
}
What am I doing wrong? (I'm very new to this).