public void DeleteForm(string keyValue) { using (var db = new SqlServerRepositoryBase().BeginTrans()) { var dbBackupEntity = db.FindEntity <DbBackupEntity>(keyValue); if (dbBackupEntity != null) { FileHelper.DeleteFile(dbBackupEntity.FilePath); } db.Delete <DbBackupEntity>(dbBackupEntity); db.Commit(); } }