Пример #1
0
        public async Task <draw> Create(draw _draw)
        {
            var data = new draw
            {
                DrawID   = _draw.DrawID,
                DrawName = _draw.DrawName,
                draw_dt  = _draw.draw_dt,
            };
            await _context.draw.AddAsync(data);

            await _context.SaveChangesAsync();

            return(data);
        }
Пример #2
0
        public async Task <Ticket> Create(Ticket ticket)
        {
            var data = new Ticket
            {
                Ticket_id = ticket.Ticket_id,
                DrawType  = ticket.DrawType,
                Number1   = ticket.Number1,
                Number2   = ticket.Number2,
                Number3   = ticket.Number3,
                Number4   = ticket.Number4,
                Number5   = ticket.Number5,
                Number6   = ticket.Number6,
                purchased = ticket.purchased
            };
            await _context.ticket.AddAsync(data);

            await _context.SaveChangesAsync();

            return(data);
        }