refactor(user): 移除where关键字优化性能

This commit is contained in:
Argo Zhang 2019-05-18 16:14:53 +08:00
parent 0dbcf08f4c
commit d98204537e
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ namespace Bootstrap.DataAccess
try
{
db.BeginTransaction();
if (!db.Exists<User>("where UserName = @0", user.UserName))
if (!db.Exists<User>("UserName = @0", user.UserName))
{
db.Insert(user);
db.Execute("insert into UserRole (UserID, RoleID) select ID, (select ID from Roles where RoleName = 'Default') RoleId from Users where UserName = @0", user.UserName);