Search code examples
asp.netidentitymembershipasp.net-mvc-5asp.net-identity

ASP.NET Identity


I'm currently building a new ASP.NET MVC 5 project which I want to release around September. I need to choose a membership system, but I'm currently quite confused about which direction should I take. The current SimpleMembership works well, but will apparently be incompatible with the upcoming ASP.NET Identity. ASP.NET Identity on the other hand is absolutely new with zero documentation and can change anytime. Finally it seems that string based IDs are used here, which seems like a very unnecessary overhead compared to integer based IDs, which SimpleMembership supports. Is there a good, future proof way I can choose?


Solution

  • I would advise against using SimpleMembership as well. You can still use int IDs in your database, you would just need to ToString() the ID when plugging in your database entity, i.e.:

    public class MyUser : IUser {
       [Key]
       int UserID { get; set; }
    
       string IUser.Id { get { return UserId.ToString(); } }
    }