ASP.NET身份 [英] ASP.NET Identity

查看:104
本文介绍了ASP.NET身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在建设一个新的ASP.NET MVC项目5,我想释放九月左右。我需要选择一个会员制,但我目前比较困惑的哪个方向,我应该采取。目前SimpleMembership运作良好,但显然将与即将推出的ASP.NET身份不符。 ASP.NET身份,另一方面是零文档完全新的,可随时更改。最后,它似乎是基于字符串的ID被用在这里,这似乎是相比于基于整型的ID很不必要的开销,这SimpleMembership支持。是否有一个良好的,面向未来的方式,我可以选择?

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?

推荐答案

我会建议不要使用SimpleMembership为好。您仍然可以使用INT的ID在你的数据库,数据库中的实体,即堵你们什么时候只需要toString()将编号:

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(); } }
}

这篇关于ASP.NET身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆