From 44dd905141e10517d34b4b53d40e31a0fed3c1bf Mon Sep 17 00:00:00 2001 From: Argo-Surface Date: Sat, 19 Jan 2019 15:53:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=EF=BC=9A?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=86=99SQL=E4=B8=8D=E5=85=BC=E5=AE=B9SQLite?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=EF=BC=8C=E6=94=B9=E7=94=A8InsertBat?= =?UTF-8?q?ch=E6=96=B9=E6=B3=95=E6=8F=92=E5=85=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UnitTest/Bootstrap.Admin/ApiTest.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UnitTest/Bootstrap.Admin/ApiTest.cs b/UnitTest/Bootstrap.Admin/ApiTest.cs index 6b5907d0..9015b251 100644 --- a/UnitTest/Bootstrap.Admin/ApiTest.cs +++ b/UnitTest/Bootstrap.Admin/ApiTest.cs @@ -9,6 +9,7 @@ using System.Linq; using System.Net.Http; using Xunit; using static Bootstrap.Admin.Controllers.Api.ExceptionsController; +using static Longbow.Data.IPetaPocoExtensions; namespace Bootstrap.Admin.Api { @@ -92,7 +93,9 @@ namespace Bootstrap.Admin.Api Assert.True(usr.Save(usr)); // Add author - DbManager.Create().Execute("delete from NavigationRole where RoleID in (select ID from Roles where RoleName = 'Default');insert into NavigationRole select ID, (select ID from Roles where RoleName = 'Default') from Navigations"); + DbManager.Create().Execute("delete from NavigationRole where RoleID in (select ID from Roles where RoleName = 'Default')"); + var rid = DbManager.Create().ExecuteScalar("select ID from Roles where RoleName = 'Default'"); + DbManager.Create().InsertBatch("NavigationRole", new Menu().RetrieveAllMenus("Admin").Select(m => new { RoleID = rid, NavigationID = m.Id })); // change theme usr.UserStatus = UserStates.ChangeTheme;