public IActionResult Delete(int id) { Cms _cmsDb = _cmsRepository.GetSingle(id); if (_cmsDb == null) { return(new NotFoundResult()); } else { IEnumerable <Field> _fields = _fieldRepository.FindBy(a => a.CmsId == id); foreach (var field in _fields) { _fieldRepository.DeleteWhere(a => a.CmsId == field.Id); _fieldRepository.Delete(field); } _cmsRepository.Delete(_cmsDb); _cmsRepository.Commit(); return(new NoContentResult()); } }
public void DeleteThirdPartyResource(int thirdPartyResourceId) { var resource = _cmsRepository.FindBy <ThirdPartyResource>(r => r.ThirdPartyResourceID == thirdPartyResourceId).FirstOrDefault(); if (resource != null) { _cmsRepository.Delete(resource); _cmsRepository.Save(); } }
public virtual void Delete(Guid id) { _entityRepository.Delete(id); SaveChanges(); }
public void Delete(Guid id) { cmsRepository.Delete(id); }