/// <summary> /// 从数据库删除DownloadBase /// </summary> /// <param name="downloadBase"></param> private void RemoveDownloadBase(string uuid) { DownloadBaseDb downloadBaseDb = new DownloadBaseDb(); downloadBaseDb.Delete(uuid); //downloadBaseDb.Close(); }
/// <summary> /// 从数据库获取所有的DownloadBase /// </summary> /// <returns></returns> private DownloadBase GetDownloadBase(string uuid) { DownloadBaseDb downloadBaseDb = new DownloadBaseDb(); object obj = downloadBaseDb.QueryById(uuid); //downloadBaseDb.Close(); return(obj is DownloadBase downloadBase ? downloadBase : null); }
/// <summary> /// 从数据库修改DownloadBase /// </summary> /// <param name="downloadBase"></param> private void UpdateDownloadBase(DownloadBase downloadBase) { if (downloadBase == null) { return; } DownloadBaseDb downloadBaseDb = new DownloadBaseDb(); downloadBaseDb.Update(downloadBase.Uuid, downloadBase); //downloadBaseDb.Close(); }
/// <summary> /// 向数据库添加DownloadBase /// </summary> /// <param name="downloadBase"></param> private void AddDownloadBase(DownloadBase downloadBase) { if (downloadBase == null) { return; } DownloadBaseDb downloadBaseDb = new DownloadBaseDb(); object obj = downloadBaseDb.QueryById(downloadBase.Uuid); if (obj == null) { downloadBaseDb.Insert(downloadBase.Uuid, downloadBase); } //downloadBaseDb.Close(); }