Ejemplo n.º 1
0
        public async Task <ActionResult <EtatCompte> > PostEtatCompte(EtatCompte etatCompte)
        {
            _context.etatComptes.Add(etatCompte);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEtatCompte", new { id = etatCompte.Id }, etatCompte));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutEtatCompte(int id, EtatCompte etatCompte)
        {
            if (id != etatCompte.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }