public void DeleteThirdPartyResource(int thirdPartyResourceId) { var resource = _cmsRepository.FindBy <ThirdPartyResource>(r => r.ThirdPartyResourceID == thirdPartyResourceId).FirstOrDefault(); if (resource != null) { _cmsRepository.Delete(resource); _cmsRepository.Save(); } }