UserManager.GetRoles doesn't work after extending the IdentityUserRole in MVC 5 Dot Net Identity

后端 未结 1 1052
轮回少年
轮回少年 2020-12-21 23:51

I have extended the IdentityUserRole by adding a foreign key column and now I am unable to Authorize or retrieve Roles information. Could please anyone help me in sorting ou

1条回答
  •  粉色の甜心
    2020-12-22 00:08

    Discriminator column is about Table per Hierarchy (TPH).refer to this link What is a Discriminator column in ASP.NET Migrations?

    About your authentication It should be something wrong with your dicriminator column.for example this code UserManager.GetRoles() has where clause for Discriminator filed to fetch data.

    SELECT [Extent1].[Id] AS [Id], [Extent1].[Name] AS [Name] FROM [dbo].[Roles] AS [Extent1]
    WHERE [Extent1].[Discriminator] = N'Role'
    

    I think your where clause value in select command which send to database is different from what value you have in database

    0 讨论(0)
提交回复
热议问题