コード例 #1
0
 public IActionResult AddMarketBetTypes([FromBody] MarketBetType marketBetType)
 {
     try
     {
         if (marketBetType == null)
         {
             return(StatusCode(400, StatusCodes.ReturnStatusObject("No items have been provided.")));
         }
         var result = _marketRepository.AddMarketBetTypes(marketBetType);
         if (result)
         {
             _logger.LogInformation("Market Successfully Added");
             return(StatusCode(200, StatusCodes.ReturnStatusObject("Successfully Added.")));
         }
         else
         {
             _logger.LogError("Market Bet Type Mapping Has Failed to Add. Market - {0}", marketBetType);
             return(StatusCode(400, StatusCodes.ReturnStatusObject("Market  Bet Type Mapping failed to add.")));
         }
     }
     catch (Exception e)
     {
         _logger.LogError("Error Market failed to add . Error - {0} , Data - {1}", e.Message, marketBetType);
         return(StatusCode(400, StatusCodes.ReturnStatusObject("Error Market  Bet Type Mapping Failed to Add.")));
     }
 }