Beispiel #1
0
        public async Task <ActionResult <SoldeConge> > PostSoldeConge(SoldeConge soldeConge)
        {
            _context.soldeConges.Add(soldeConge);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSoldeConge", new { id = soldeConge.Id }, soldeConge));
        }
Beispiel #2
0
        public async Task <IActionResult> PutSoldeConge(int id, SoldeConge soldeConge)
        {
            if (id != soldeConge.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }