mark-j / dapper-identity

ASP.NET Core Identity with Dapper instead of Entity Framework
https://markjohnson.io/articles/asp-net-core-identity-without-entity-framework/
MIT License
192 stars 56 forks source link

UserStore bug #1

Open gtaylor44 opened 6 years ago

gtaylor44 commented 6 years ago

This doesn't look right:

UserStore.cs

                if (!roleId.HasValue)
                    roleId = await connection.ExecuteAsync($"INSERT INTO [ApplicationRole]([Name], [NormalizedName]) VALUES(@{nameof(roleName)}, @{nameof(normalizedName)})",
                        new { roleName, normalizedName });

This will return the number of affected records.

You should use an output param with the newly inserted id instead.