示例#1
0
        public async Task <ActionResult <Itinerarydetails> > PostItinerarydetails(Itinerarydetails itinerarydetails)
        {
            _context.Itinerarydetails.Add(itinerarydetails);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetItinerarydetails", new { id = itinerarydetails.Itinerarydetailid }, itinerarydetails));
        }
示例#2
0
        public async Task <IActionResult> PutItinerarydetails(int id, Itinerarydetails itinerarydetails)
        {
            if (id != itinerarydetails.Itinerarydetailid)
            {
                return(BadRequest());
            }

            _context.Entry(itinerarydetails).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ItinerarydetailsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }