public async Task <IActionResult> ListClient() { try { return(Ok(await instacli.ListClients())); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } }
public async Task <int> CreateNewBet(Bet newbet) { newbet.BetColor = "Black"; if ((newbet.BetNumber % 2) == 0) { newbet.BetColor = "Red"; } newbet.IdBet = _listBet.Count() + 1; _listBet.Add(newbet); var Listcli = await instacli.ListClients(); foreach (var cli in Listcli) { if (newbet.IdClient == cli.Id) { cli.AmountAvailable = cli.AmountAvailable - newbet.BetAmount; } } return(newbet.IdBet); }