C#学习教程:在不使用Microsoft.AspNet.Identity.EntityFramework的情况下自定义Asp.netmvc5认证.AspNet.Identity.EntityFramework的UserStore?您所要做的就是实现与Identity.Entityframework的用户存储相同的接口。User将是你的用户类publicclassMyUserStore:IUserLoginStore,IUserClaimStore,IUserRoleStore,IUserPasswordStore,IUserSecurityStampStore,IUserStore,IDisposablewhereTUser:User{//实现你需要的接口}然后每次请求都将MyUserStore传递给UserManagernewUserManager(newMyUserStore(newMyContext()))您可以从GitHub上的以下项目中获取UserStore.cs模板并根据您的需要进行调整,它将让您摆脱对Microsoft.AspNet.Identity.EntityFramework的依赖。https://github.com/kriasoft/AspNet-Server-Template->./src/App.Server/Data/UserStore.cs(免责声明:我是这个项目模板的作者)以上是C#学习教程:自定义Asp.netmvc5身份验证不使用Microsoft.AspNet.Identity.EntityFramework共享的所有内容。如果对你有用,需要进一步了解C#学习教程,希望大家多多关注。本文来自网络收集,并不代表侵权,请点击右边联系管理员删除。如需转载请注明出处:
