public async Task CreateBet(BetBindingModel model) { IUser account = await this._userManager.FindByNameAsync(User.Identity.Name); CreateBetResponse response = await this._betsService.CreateBet( new CreateBetRequest { AccountId = Guid.Parse(account.Id), EventId = model.EventId, BetAmount = model.BetAmount, OutcomesType = model.OutcomesType }); }
public IActionResult RegisterBet(BetBindingModel model) { var evnt = this.DbContext.Events.FirstOrDefault(e => e.Address == model.EventAddress); if (evnt != null) { evnt.Bets.Add(new Bet() { Address = model.CustomerAddress }); this.DbContext.SaveChanges(); } return(this.Ok()); }