public IActionResult DeleteBlog(string name) { try { var data = _blogDataService.GetCollectionData(name); if (data is null) { return(NotFound()); } _blogDataService.DeleteCollectionData(data.BlogDocument.BlogDetails.Title, data.BlogDocument.UserDetails.UserName); _blogsService.DeleteBlog(data.BlogDocument.BlogDetails.Title); return(NoContent()); } catch (Exception e) { Log.Warning($"Request ended with error: {e.Message}"); return(BadRequest(e.Message)); } }