Exemple #1
0
        public async Task <ActionResult <NotifCars> > PostNotifCars(NotifCars notifCars)
        {
            _context.notifCars.Add(notifCars);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetNotifCars", new { id = notifCars.Id }, notifCars));
        }
Exemple #2
0
        public async Task <IActionResult> PutNotifCars(int id, NotifCars notifCars)
        {
            if (id != notifCars.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }