linq2db / LinqToDB.Identity

ASP.NET Core Identity provider that uses LinqToDB.
https://linq2db.github.io/
MIT License
46 stars 9 forks source link

UserManager.GetRolesAsync(user) Error. #16

Closed DmitrijOkeanij closed 5 years ago

DmitrijOkeanij commented 5 years ago

I use default Identity classes. And this initialization at sturtup. Users and Roles have int id.

.AddLinqToDBStores<int>(dataBaseFactory) 
.AddUserManager<UserManager<User>>()
.AddRoleManager<RoleManager<UserGroup>>()

I tried to

var roles = await userManager.GetRolesAsync(user);

Throw exceprion

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1`userRole INNER JOIN AspNetRoles role_1 ON userRole.RoleId = `role' at line 4

DmitrijOkeanij commented 5 years ago

Oh. Sorry. Solved by adding mapping to UserRoles. But error massage a little strange, and was difficult to understand correlation.

MaceWindu commented 5 years ago

I think it is the same issue as #15. Bigger problem is that right now we don't have active maintainer for this package...

MaceWindu commented 5 years ago

Message is strange, because linq2db failed to escape table name identifier. Otherwise it should have complained about unknown table userroles`1. I will create issue for linq2db