I am writing an MVC 3 application and I am trying to implement my own custom membership provider (following the example in Apress' Pro ASP.NET MVC 3 Framework).
I created my own class inherited from MembershipProvider and (using ReSharper) implemented all 27 methods with NotImplementedExceptions.
Now I have overridden the ValidateUser method, since it states the state and it works fine, but I would like to make my provider more reliable and implement other methods (for example, set MinRequiredPasswordLength and GetNumberOfUsersOnline).
Is there any example code that I can use to start populating these methods that I can customize to fit my own DB / Model schema?
I can, of course, use a trial version and an error to figure this out, but an example of the base code will help a lot.
EDIT: This question was simply omitted twice. If you are going to do the bottom, please write a comment about why I can work to improve my questions.
EDIT 2: For example, for the following method:
public override int GetNumberOfUsersOnline() { throw new System.NotImplementedException(); }
I can try to write code from scratch to look at some kind of weblog, determine the login time and approximate if they are still on, but it will take a lot of time. Since all this code has the same interface that Microsoft wrote for the standard SqlMembershipProvider, are there any code (even from MS) that contains this method? If so, I want to take it, change it so that it uses my DB schema instead of the default aspnetdb schema. I would rather have some kind of basic code to work with. I thought this would be a simple and fairly standard query, but maybe not.
source share