Пример #1
0
        public async Task <ActionResult <Trip> > PostTrip(Trip trip)
        {
            _context.Trips.Add(trip);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTrip", new { id = trip.Id }, trip));
        }
Пример #2
0
        public async Task <ActionResult <Line> > PostLine(Line line)
        {
            _context.Lines.Add(line);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLine", new { id = line.Id }, line));
        }