scallan/AspNet-Identity-2-Hack-of-John-Atten-Customizing-Suers-and-Roles — pull request #3 by xivSolutions (2014-08-14 12:03:00+00:00)
Title: Implemented crude Client Forums Feature. Closes #2

It's crude, but the basics are here. Note that the simplest way to handle many-to-many relationships (that I know of) in code is how I've done it here. the `ApplicationUser` object and the `ClientForum` object each hold a collection of reference objects, containing the mapping from one to the other.

This is similar to how Identity itself handles the mapping between `Roles` and `Users`. You may have noticed that (for example) `ApplicationUSer` does not contain a collection of actual `Role` objects, but instead a collection of `ApplicationUserRole` objects.

The magic then happens [Here, in the ApplicationDbContext](https://github.com/xivSolutions/AspNet-Identity-2-Hack-of-John-Atten-Customizing-Suers-and-Roles/blob/master/AspNetIdentity2ExtensibleTemplate/Models/IdentityModels.cs#L87) where we override `OnModelCreating` and let EF know about our many-to-many mapping.

There are different ways to handle the Controller/View implementation - here, I just went with what was simple to demo how to do the code.

From here, you can tune it up, make changes, try new things. It is possible to add the 'ClientForums' selection bits to the Create and Edit Users views, but things get more complex. For now, I just linked to a `ClientForums` View from the `Index` View.

Let me know if you have questions, or need help beating this into submission.

Oh, yeah. You need a complex password or login fails. Passwords in the Samples project need to have at least a number and a "special character" so the password you had in your Identity.cofig wasn't working.