refactor(user): 移除where关键字优化性能
This commit is contained in:
parent
0dbcf08f4c
commit
d98204537e
|
@ -218,7 +218,7 @@ namespace Bootstrap.DataAccess
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
db.BeginTransaction();
|
db.BeginTransaction();
|
||||||
if (!db.Exists<User>("where UserName = @0", user.UserName))
|
if (!db.Exists<User>("UserName = @0", user.UserName))
|
||||||
{
|
{
|
||||||
db.Insert(user);
|
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);
|
db.Execute("insert into UserRole (UserID, RoleID) select ID, (select ID from Roles where RoleName = 'Default') RoleId from Users where UserName = @0", user.UserName);
|
||||||
|
|
Loading…
Reference in New Issue