none
asp.net identity 2.0 自定义user,role,userrole的问题. RRS feed

  • Pertanyaan

  • 我的项目使用的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/

    Jumat, 19 Desember 2014 20.30

Jawaban

Semua Balasan