Exemplo n.º 1
0
        public async Task <IActionResult> Delete([FromBody] Guid id)
        {
            var alias = await _service.Delete(id);

            if (alias != null)
            {
                var result = await _service.GetList(alias.SiteId);

                result.Status = new StatusMessage
                {
                    Type = StatusMessage.Success,
                    Body = _localizer.Alias["The alias was successfully deleted"]
                };

                return(Ok(result));
            }
            return(NotFound());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var alias = await _service.Delete(id);

            if (alias != null)
            {
                var result = await _service.GetList(alias.SiteId);

                result.Status = new StatusMessage
                {
                    Type = StatusMessage.Success,
                    Body = $"The alias <code>{ alias.AliasUrl }</code> was deleted"
                };

                return(Ok(result));
            }
            return(NotFound());
        }