Example #1
0
        public async Task <ActionResult <DriverResume> > PostDriverResume(DriverResume driverResume)
        {
            _context.DriverResume.Add(driverResume);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetDriverResume", new { id = driverResume.Id }, driverResume));
        }
Example #2
0
        public async Task <IActionResult> PutDriverResume(int id, DriverResume driverResume)
        {
            if (id != driverResume.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }