Esempio n. 1
0
        public IActionResult DeleteOdd(long?id)
        {
            try
            {
                if (id.HasValue)
                {
                    _logger.LogInformation("API Request hit: DELETE Odds : " + id.Value);
                    var result = _marketRepository.DeleteOdd(id.Value);

                    if (result == 0)
                    {
                        return(Ok("{\"status\": \"Success\"}"));
                    }
                    else
                    {
                        _logger.LogInformation("API Request (DELETE Odds : " + id.Value + " ) not committed");
                        return(NotFound("Failed: DELETE could not commit"));
                    }
                }
                else
                {
                    _logger.LogInformation("API Request hit (DELETE Odds) with null entry");
                    return(BadRequest("Failed: null entry"));
                }
            }

            catch (Exception e)
            {
                _logger.LogError("API Request (DELETE Odds) FAILED: ", e);
                return(BadRequest("Failed"));
            }
        }