示例#1
0
        public async Task <Ticket> CreateTicket(Ticket ticket)
        {
            if (ticket == null)
            {
                throw new ArgumentNullException(nameof(ticket));
            }

            await _context.Tickets.AddAsync(ticket);

            await _context.SaveChangesAsync();

            return(ticket);
        }
示例#2
0
        public async Task <Event> CreateEvent(Event evt)
        {
            if (evt == null)
            {
                throw new ArgumentNullException(nameof(evt));
            }

            await _context.Events.AddAsync(evt);

            await _context.SaveChangesAsync();

            return(evt);
        }