Exemple #1
0
        public async Task <ActionResult <EtatListCompte> > PostEtatListCompte(EtatListCompte etatListCompte)
        {
            _context.etatListComptes.Add(etatListCompte);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEtatListCompte", new { id = etatListCompte.Id }, etatListCompte));
        }
Exemple #2
0
        public async Task <IActionResult> PutEtatListCompte(int id, EtatListCompte etatListCompte)
        {
            if (id != etatListCompte.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }