public async Task <bool> Delete(ISiteSettings site) { // we will need a provider model or something similar here to // allow other features and 3rd party features to delete // related data when a site is deleted // TODO: implement // will ProviderModel be available in Core Framework or will we have to use something else // a way to use dependency injection? // delete users bool resultStep = await userRepo.DeleteUsersBySite(site.SiteId, CancellationToken.None); // this also deletes userroles claims logins resultStep = await userRepo.DeleteRolesBySite(site.SiteId, CancellationToken.None); resultStep = await siteRepo.DeleteHostsBySite(site.SiteId, CancellationToken.None); //resultStep = await siteRepo.DeleteFoldersBySite(site.SiteGuid, CancellationToken.None); // the below method deletes a lot of things by siteid including the following tables // Exec mp_Sites_Delete // mp_UserRoles // mp_UserProperties // mp_UserLocation // mp_Users // mp_Roles // mp_SiteHosts // mp_SiteFolders // mp_SiteSettingsEx // mp_Sites return(await siteRepo.Delete(site.SiteId, CancellationToken.None)); }
/// <summary> /// Deletes the given model. /// </summary> /// <param name="model">The model</param> public async Task DeleteAsync(Site model) { // Call hooks & delete App.Hooks.OnBeforeDelete(model); await _repo.Delete(model.Id).ConfigureAwait(false); App.Hooks.OnAfterDelete(model); // Remove from cache RemoveFromCache(model); }
public bool Delete(int id) { if (string.IsNullOrWhiteSpace(id.ToString())) { return(status); } else { var result = _siteRepository.Delete(id); return(result); } }
public async Task <ActionResult <Site> > DeleteAsync(int id) { var site = await _repository.GetSiteAsync(id); if (site == null) { return(NotFound()); } _repository.Delete(site); if (await _repository.SaveAllAsync()) { return(Ok()); } return(BadRequest()); }
public IActionResult Delete(Guid id) { try { var deleted = _siteRepository.Delete(id); if (deleted == null) { return(BadRequest($"The site with given {id} could not be found")); } return(NoContent()); } catch (Exception e) { _logger.LogError($"An error occured while performing delete operation with given exception: {e}"); return(StatusCode(StatusCodes.Status500InternalServerError)); } }
public bool DeleteSite(Guid id) { return(_siteRepository.Delete(id)); }
//Delete site public void Delete(Guid siteId) { _repository.Delete(siteId); }
//Delete Site: public void DeleteSite(int id) { var site = _repoSite.Get(id); _repoSite.Delete(site); }
public async Task RemoveSite(long id) { _siteRepository.Delete(id); await _uow.CommitAsync(); }
public bool Delete(string siteId) { return(siteRepository.Delete(siteId)); }