// // GET: /Settings/Delete/5 public ActionResult Delete(int id) { IRepository <Models.Settings> repo = new SettingsRepository(); repo.Delete(repo.GetById(id)); return(RedirectToAction("Index")); }
public void DeleteIsNotSupported() { // Arrange ISettingsRepository repo = new SettingsRepository("non.existing.file"); // Act // Assert ExceptionAssert.Throws <NotSupportedException>(() => repo.Delete(new GSD.Models.Config())); }
public static void DeleteSettings(string tagName) { using (ISettingsRepository settingRepository = new SettingsRepository(true)) { settingRepository.Delete<Mediaportal.TV.Server.TVDatabase.Entities.Setting>(s => s.Tag == tagName); settingRepository.UnitOfWork.SaveChanges(); } }
public DbResult Delete(string id) { return(repo.Delete(id)); }