public void DeleteFile(int fileId) { DepotManagementDataContext ctx = CommentParameter.DepotDataContext; var varData = from a in ctx.FM_FileList where a.FileID == fileId select a; if (varData.Count() != 1) { throw new Exception("数据不唯一"); } FileOperationService.File_Delete(varData.Single().FileUnique, CE_CommunicationMode.FTP); ctx.FM_FileList.DeleteAllOnSubmit(varData); ctx.SubmitChanges(); }