Over the weekend my employer ran a 24-hour "hackathon" where we developed a product that utilised the FitBit API and related to metal health. We managed to scrape together an all female team and built a "mood tracker" that combines sleep and activity data from FitBit with your current mood - you can check it out at moodboardapp.com. I decided to use MVC5 and Microsoft ASP.NET Identity for this and it proved to be very interesting. I don't know if it was the best choice when we only had 24 hours to get it working, but we did eventually get it ing.

One of the first problems I came up again was that the standard IUserStore implementation expects a string identifier. This really confused me and I spent a while trying to get it to work with a Guid/uniqueidentifier only to end up having a DB model with a Guid Id and an ApplicationUser with a string Id. I then mapped between the two in my UserStore which kept my database looking nicer.

Since I was using NHibernate rather than EntityFramework (this is the norm for me, I don't really like EntityFramework) I also had issues when saving my users which meant I had to execute the update using Merge in NHibernate. I also found that when AutoMapping between my objects, if the ApplicationUser didn't have all the properties set it wouldn't execute the update in the UserStore. It didn't throw an error, it just didn't update.

I'm working on cleaning up the code and will upload it to GitHub shortly.