duheng
2024-12-04 3886a51f03ec14650e5b7127539104ad40e496da
Service/HStation.Service.Xhs.Core/04-dal/03-sqlite/XhsProject.cs
@@ -137,37 +137,6 @@
            }
        }
        /// <summary>
        /// 通过 ID 删除 (拓展)
        /// </summary>
        public bool DeleteExByID(long ID)
        {
            if (ID < 1)
            {
                return false;
            }
            using (var db = new SqlSugarClient(ConnectionConfig))
            {
                try
                {
                    db.BeginTran();
                    var bol = db.Deleteable<Entity.XhsProject>().Where(x => x.ID == ID).ExecuteCommandHasChange();
                    if (!bol)
                    {
                        db.RollbackTran();
                        return false;
                    }
                    db.Deleteable<Entity.XhsProjectSite>().Where(x => x.ProjectID == ID).ExecuteCommandHasChange();
                    db.CommitTran();
                    return true;
                }
                catch
                {
                    db.RollbackTran();
                    throw;
                }
            }
        }
    }