diff --git a/APIJSON.NET/APIJSON.NET.Test/APIJSON.NET.Test.csproj b/APIJSON.NET/APIJSON.NET.Test/APIJSON.NET.Test.csproj index 50ab43e..7a13087 100644 --- a/APIJSON.NET/APIJSON.NET.Test/APIJSON.NET.Test.csproj +++ b/APIJSON.NET/APIJSON.NET.Test/APIJSON.NET.Test.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + netcoreapp2.2 diff --git a/APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj b/APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj index ade59f1..f7bd43b 100644 --- a/APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj +++ b/APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp2.2 @@ -15,21 +15,21 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs b/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs index 4f11e5a..6590965 100644 --- a/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs +++ b/APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs @@ -251,15 +251,14 @@ public ActionResult Edit([FromBody]string json) } var dt = new Dictionary(); - dt.Add("id", value["id"].ToString()); foreach (var f in value) { if (f.Key.ToLower() != "id"&& selectTable.IsCol(key,f.Key) && (role.Update.Column.Contains ("*")||role.Update.Column.Contains(f.Key, StringComparer.CurrentCultureIgnoreCase))) { - dt.Add(f.Key, f.Value); + dt.Add(f.Key, f.Value.ToString()); } } - db.Db.Updateable(dt).AS(key).ExecuteCommand(); + db.Db.Updateable(dt).AS(key).Where("id=@id" ,new { id= value["id"].ToString() }).ExecuteCommand(); ht.Add(key, JToken.FromObject(new { code = 200, msg = "success", id = value["id"].ToString() })); } } diff --git a/APIJSON.NET/APIJSON.NET/Data/DbContext.cs b/APIJSON.NET/APIJSON.NET/Data/DbContext.cs index 07eb061..d3c8754 100644 --- a/APIJSON.NET/APIJSON.NET/Data/DbContext.cs +++ b/APIJSON.NET/APIJSON.NET/Data/DbContext.cs @@ -14,9 +14,8 @@ public DbContext(IConfiguration options) Db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = options.GetConnectionString("ConnectionString"), - DbType = (DbType)Enum.Parse(typeof(SqlSugar.DbType), options.GetConnectionString("DbType")), - IsAutoCloseConnection = true, - InitKeyType= InitKeyType.Attribute + DbType = (DbType)Enum.Parse(typeof(SqlSugar.DbType), options.GetConnectionString("DbType")), InitKeyType= InitKeyType.Attribute, + IsAutoCloseConnection = true }); Db.Aop.OnLogExecuted = (sql, pars) => //SQL执行完事件 { diff --git a/APIJSON.NET/APIJSON.NET/appsettings.json b/APIJSON.NET/APIJSON.NET/appsettings.json index 57a7a3f..6e284d5 100644 --- a/APIJSON.NET/APIJSON.NET/appsettings.json +++ b/APIJSON.NET/APIJSON.NET/appsettings.json @@ -1,7 +1,7 @@ { "ConnectionStrings": { "DbType": 1, //0:MySql,1:SqlServer,2:Sqlite - "ConnectionString": "Server=liaozengbo\\sql2018; Database=Sample; User Id=sa;Password=sa123;" + "ConnectionString": "Server=LIAOZENGBO\\SQL2012; Database=Testdb; User Id=sa;Password=sa123;" //"ConnectionString": "Server=119.29.9.25;Port=3306;Database=test;Uid=root;Pwd=1q,2w.3e?;CharSet=UTF8;" }, "Authentication": { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy