public async Task <IActionResult> DeleteSelectedSeNames(ICollection <string> selectedIds) { if (selectedIds != null) { var entityUrls = new List <EntityUrl>(); foreach (var id in selectedIds) { var entityUrl = await _slugService.GetEntityUrlById(id); if (entityUrl != null) { entityUrls.Add(entityUrl); } } foreach (var entityUrl in entityUrls) { await _slugService.DeleteEntityUrl(entityUrl); } } return(Json(new { Result = true })); }
public async Task Handle(EntityDeleted <BlogPost> notification, CancellationToken cancellationToken) { var urlToDelete = await _slugService.GetBySlug(notification.Entity.SeName); await _slugService.DeleteEntityUrl(urlToDelete); }