/// <summary> /// 插入下载地址,插入前先判断这个地址是否已经存在 /// </summary> /// <param name="model"></param> /// <returns></returns> public int SaveDownload(Download_Repository model) { int?movieID = GetDownloadIDByMagnet(model.Magnet); if (!movieID.HasValue) { return(Insert(model)); } else { return(movieID.Value); } }
/// <summary> /// 插入下载地址 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Insert(Download_Repository model) { return(db.Add <int>(model)); }