public TicketToGame CreateTicketToGame(int SportGameId, int ticketId, double PairCoefficient, string selectedValue)
        {
            var ticketToGame = new TicketToGame();

            ticketToGame.SportGameId     = SportGameId;
            ticketToGame.SelectedValue   = selectedValue;
            ticketToGame.PairCoefficient = PairCoefficient;
            ticketToGame.TicketId        = ticketId;
            _context.TicketToGames.Add(ticketToGame);
            _context.SaveChanges();
            return(_context.TicketToGames.ToList().Last());
        }
Exemplo n.º 2
0
        public Ticket CreateTicket(double payment, double totalCoeficient, double expectedPayout)
        {
            var profile = _context.Profiles.First();
            var ticket  = new Ticket
            {
                Payment         = payment,
                ProfileId       = profile.Id,
                CurrentlyActive = false,
                TotalCoeficient = totalCoeficient,
                ExpectedPayout  = expectedPayout,
            };

            _context.Tickets.Add(ticket);
            _context.SaveChanges();
            return(_context.Tickets.ToList().Last());
        }