Ejemplo n.º 1
0
        /// <summary>
        /// Asks the service to delete the echo uniquely identified through Id.
        /// </summary>
        /// <param name="id">
        /// The echos unique identifier.
        /// </param>
        /// <returns>
        /// HTTP Status Code 204 - No Content if echo was successfully deleted, or did not exist,
        ///     HTTP Status Code 500 - Internal Server Error if the other codes don't apply. Contains exception on DEBUG.
        /// </returns>
        public IHttpActionResult Delete(int id)
        {
            var result = _echoService.Delete(id);

            if (result.ActionStatus.Status == ActionStatusEnum.Success)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }

            return(HandleErrorActionResult(result));
        }