Exemplo n.º 1
0
        public async Task <IActionResult> Delete(Guid pageId, string slug)
        {
            try
            {
                await _customPageService.DeleteAsync(pageId);

                _cache.Remove(CacheDivision.Page, slug.ToLower());
                return(Json(pageId));
            }
            catch (Exception e)
            {
                Logger.LogError(e, $"Error Delete CustomPage, Id: {pageId}.");
                return(ServerError());
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(Guid pageId, string slug)
        {
            try
            {
                var response = await _customPageService.DeleteAsync(pageId);

                if (response.IsSuccess)
                {
                    var cacheKey = $"page-{slug.ToLower()}";
                    _cache.Remove(cacheKey);

                    return(Json(pageId));
                }

                return(ServerError());
            }
            catch (Exception e)
            {
                Logger.LogError(e, $"Error Delete CustomPage, Id: {pageId}.");
                return(ServerError());
            }
        }