Beispiel #1
0
        public async Task <ActionResult <esfFuelTypes> > PostesfFuelTypes(esfFuelTypes esfFuelTypes)
        {
            _context.esfFuelTypes.Add(esfFuelTypes);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetesfFuelTypes", new { id = esfFuelTypes.fuID }, esfFuelTypes));
        }
Beispiel #2
0
        public async Task <IActionResult> PutesfFuelTypes(int fuID, esfFuelTypes esfFuelTypes)
        {
            if (fuID != esfFuelTypes.fuID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }