Exemplo n.º 1
0
        public async Task <ActionResult <Client.Models.Bet> > PostBet(Client.Models.BetMeta betForCreating)
        {
            var newBetMeta = mapper.Map <BetMeta>(betForCreating);
            var newBet     = mapper.Map <BettingShop.DataLayer.Models.Bet>(newBetMeta);
            await repo.CreateAsync(newBet);

            return(CreatedAtAction(nameof(GetBet), new { id = newBet.Id }, mapper.Map <Client.Models.Bet>(newBet)));
        }