public IActionResult DeleteLocker([FromQuery] int id) { if (_contentRepo.DeleteContent(id)) { return(Ok()); } return(NotFound()); }
public IActionResult DeleteContent([FromBody] ContentForm _cont) { TimeZoneInfo zone = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time"); DateTime dateTime = TimeZoneInfo.ConvertTime(DateTime.Now, zone); //if deleting content success if (_contentRepo.DeleteContent(_cont.Id_content)) { Log.Information("Delete content {id} OK. {DateTime}.", _cont.Id_content, dateTime); return(Ok(_cont.Id_content)); } //if deleting content fail Log.Information("Cannot Delete content {id}. {DateTime}.", _cont.Id_content, dateTime); return(NotFound(_cont.Id_content)); }
public bool DeleteContent(int id) { try { bool result = false; IContentRepository repos = new ContentRepository(); result = repos.DeleteContent(id); if (result) { Helpers.CacheHelper.RemoveObjectFromCache(Helpers.CacheHelperKeys.CK_ALL_PAGES); } return(result); } catch (Exception) { throw; } }
public bool DeleteContent(int contentID) { return(ContentRepository.DeleteContent(contentID)); }
public bool Delete(int id) { return(_repo.DeleteContent(id)); }