Skip to content

Commit d0c716c

Browse files
committed
#更新sdk#
1 parent 2e71556 commit d0c716c

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

APIJSON.NET/APIJSON.NET.Test/APIJSON.NET.Test.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>netcoreapp2.2</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
@@ -15,21 +15,21 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.1.0" />
19-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.5" />
20-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.1.2" />
21-
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.1.1" />
22-
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.1.1" />
23-
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.1.3" />
24-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.5" />
25-
<PackageReference Include="MySql.Data" Version="8.0.13" />
26-
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.18.3" />
27-
<PackageReference Include="SqlKata" Version="1.1.3" />
28-
<PackageReference Include="SqlKata.Execution" Version="1.1.3" />
29-
<PackageReference Include="sqlSugarCore" Version="4.9.3" />
30-
<PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" />
31-
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="3.0.0" />
32-
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="3.0.0" />
18+
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.2.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.3" />
20+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
21+
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
22+
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
23+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.2.0" />
24+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
25+
<PackageReference Include="MySql.Data" Version="8.0.15" />
26+
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.18.5" />
27+
<PackageReference Include="SqlKata" Version="1.1.7" />
28+
<PackageReference Include="SqlKata.Execution" Version="1.1.7" />
29+
<PackageReference Include="sqlSugarCore" Version="4.9.9.2" />
30+
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
31+
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="4.0.1" />
32+
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="4.0.1" />
3333
</ItemGroup>
3434

3535
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="http://json.schemastore.org/config" /></VisualStudio></ProjectExtensions>

APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,14 @@ public ActionResult Edit([FromBody]string json)
251251
}
252252

253253
var dt = new Dictionary<string, object>();
254-
dt.Add("id", value["id"].ToString());
255254
foreach (var f in value)
256255
{
257256
if (f.Key.ToLower() != "id"&& selectTable.IsCol(key,f.Key) && (role.Update.Column.Contains ("*")||role.Update.Column.Contains(f.Key, StringComparer.CurrentCultureIgnoreCase)))
258257
{
259-
dt.Add(f.Key, f.Value);
258+
dt.Add(f.Key, f.Value.ToString());
260259
}
261260
}
262-
db.Db.Updateable(dt).AS(key).ExecuteCommand();
261+
db.Db.Updateable(dt).AS(key).Where("id=@id" ,new { id= value["id"].ToString() }).ExecuteCommand();
263262
ht.Add(key, JToken.FromObject(new { code = 200, msg = "success", id = value["id"].ToString() }));
264263
}
265264
}

APIJSON.NET/APIJSON.NET/Data/DbContext.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ public DbContext(IConfiguration options)
1414
Db = new SqlSugarClient(new ConnectionConfig()
1515
{
1616
ConnectionString = options.GetConnectionString("ConnectionString"),
17-
DbType = (DbType)Enum.Parse(typeof(SqlSugar.DbType), options.GetConnectionString("DbType")),
18-
IsAutoCloseConnection = true,
19-
InitKeyType= InitKeyType.Attribute
17+
DbType = (DbType)Enum.Parse(typeof(SqlSugar.DbType), options.GetConnectionString("DbType")), InitKeyType= InitKeyType.Attribute,
18+
IsAutoCloseConnection = true
2019
});
2120
Db.Aop.OnLogExecuted = (sql, pars) => //SQL执行完事件
2221
{

APIJSON.NET/APIJSON.NET/appsettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"ConnectionStrings": {
33
"DbType": 1, //0:MySql,1:SqlServer,2:Sqlite
4-
"ConnectionString": "Server=liaozengbo\\sql2018; Database=Sample; User Id=sa;Password=sa123;"
4+
"ConnectionString": "Server=LIAOZENGBO\\SQL2012; Database=Testdb; User Id=sa;Password=sa123;"
55
//"ConnectionString": "Server=119.29.9.25;Port=3306;Database=test;Uid=root;Pwd=1q,2w.3e?;CharSet=UTF8;"
66
},
77
"Authentication": {

0 commit comments

Comments
 (0)