积极答复者
asp.net identity 2.0 自定义user,role,userrole的问题.

问题
-
我的项目使用的asp.net identity2.0 作为用户身份认证的内核
之前只是对 identityuser 和 identityrole 进行的扩展,如下:
Public Class ApplicationUser Inherits IdentityUser '... End Class
Public Class ApplicationRole Inherits IdentityRole <Display(Name:="排序")> Property Sort As Short = 0 <Display(Name:="备注"), StringLength(100)> Property Remark As String = "" End Class
而现在的项目中,想利用user和role的关联操作,所以对identityuserrole,上下文,也进行了扩展
Public Class ApplicationUserRole Inherits IdentityUserRole <ForeignKey("RoleId")> Overridable Property role As ApplicationRole <ForeignKey("UserId")> Overridable Property user As ApplicationUser End Class
Public Class ShiGuangDbContext Inherits IdentityDbContext(Of ApplicationUser, ApplicationRole, String, ApplicationUserLogin, ApplicationUserRole, ApplicationUserClaim) '... End Class
而现在问题来了..对管理器扩展的时候,出现了冲突:有人这样做过没有?
请高手指点迷津
MVC 深入研究 博客:http://www.cnblogs.com/DoduNet/
MvcMovieStore 示例网站:MVC 影视 http://MvcMovie.cn/
答案
-
參考一下這個
大家一齊探討、學習和研究,謝謝!
MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
MCT, Microsoft Community Star(TW & HK),
Microsoft MVP for VB.NET since 2003
My MSMVP Blog
請記得將對您有幫助的回覆標示為解答以幫助其他尋找解答及參與社群討論的朋友們。
Please remember to clickMark as Answer on the post that helps you. This can be beneficial to other community members reading the thread.- 已标记为答案 Will ShaoMicrosoft employee, Moderator 2015年1月8日 2:21
全部回复
-
- 已编辑 Kevin Shen 2014年12月23日 3:02
-
參考一下這個
大家一齊探討、學習和研究,謝謝!
MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
MCT, Microsoft Community Star(TW & HK),
Microsoft MVP for VB.NET since 2003
My MSMVP Blog
請記得將對您有幫助的回覆標示為解答以幫助其他尋找解答及參與社群討論的朋友們。
Please remember to clickMark as Answer on the post that helps you. This can be beneficial to other community members reading the thread.- 已标记为答案 Will ShaoMicrosoft employee, Moderator 2015年1月8日 2:21
-
你好, 你给的参考中的 ExampleStorageContext 这个类是怎么实现的呢?
MVC 深入研究 博客:http://www.cnblogs.com/DoduNet/
MvcMovieStore 示例网站:MVC 影视 http://MvcMovie.cn/