title: Custom MembershipProvider in MVC 4
body: <p>I'm a starting to learn about MVC4. As first steps, I need to perform a login since a custom database with just three roles in the database.</p>
  
  <p>Is it realy necessary to implement a custom membership provider? I'm question this because I was reading this post and he's doing another way: <a href="http://patrickdesjardins.com/blog/asp-net-membership-with-mvc4">http://patrickdesjardins.com/blog/asp-net-membership-with-mvc4</a></p>
  
  <p>I just need to get users from a custom database and determine the role.</p>
  
  <p>To determine the rule, is a quite simple. I've got two tables called Students and Teachers. Each one has its Id as is loggin Id, and the common property password.</p>
  
  <pre><code>if (db.Students.Where(x =&gt; x.StudentId == x &amp;&amp; x.Password == y) return "student"
  if (db.Teachers.Where(x =&gt; x.TeacherId == x &amp;&amp; x.Password == y) return "teacher"
  
  // does not exist
  </code></pre>
  
  <p>Can you orient me about how to implement this features in ASP.NET?</p>