title: Sample Code for Creating Custom Membership Provider
body: <p>I am writing an MVC 3 application and I am trying to implement my own custom membership provider (following the sample in Apress' Pro ASP.NET MVC 3 Framework).  </p>
  
  <p>I created my custom class, inherited from MembershipProvider and (using ReSharper) implemented all 27 of the methods with NotImplementedExceptions.  </p>
  
  <p>Now, I have overridden the ValidateUser method as the book states and it works fine, but I would like to make my provider more robust and implement the other methods (e.g. set MinRequiredPasswordLength and GetNumberOfUsersOnline).  </p>
  
  <p>Is there some sample code that I can use to start populating these methods that I can tweak to fit my own DB/Model schema?  </p>
  
  <p>I can certainly use trial and error to figure it out, but a base code sample would greatly help. </p>
  
  <p><strong>EDIT:</strong>
  This question was just downvoted twice.  If you are going to downvote, please post a comment as to why so that I can work on improving my questions.</p>
  
  <p><strong>EDIT 2:</strong>
  For example, for the following method:</p>
  
  <pre><code>public override int GetNumberOfUsersOnline()
  {
    throw new System.NotImplementedException();
  }
  </code></pre>
  
  <p>I can try to write code from scratch to look at some web log, determine the users login time and approximate if they are still on, but that will take a large amount of time for me to figure out.  Since all this code is from the same interface that Microsoft wrote for the standard SqlMembershipProvider, isn't there code out there (even from MS) that contains this method?  If so, I want take it, modify it so it uses my DB schema instead of the aspnetdb default schema.  I would prefer to have some sort of base code to work from.  I thought this would be a simple and fairly standard request, but perhaps not.</p>