giorgos07/Daarto

UsersTable:GetUsersInRoleAsync - ApplicationUser.Id is Role.Id

ArryMatt opened this issue · 0 comments

Dapper is mapping the Id from the Roles table in this query to the ApplicationUser object:

const string command = "SELECT * " +
                       "FROM dbo.Users AS u " +
                       "INNER JOIN dbo.UserRoles AS ur ON u.Id = ur.UserId " +
                       "INNER JOIN dbo.Roles AS r ON ur.RoleId = r.Id " +
                       "WHERE r.Name = @RoleName;";

SELECT u.* fixes the issue.

Same issue in GetUsersForClaimAsync.