Exemple #1
0
        public async Task <ActionResult <TAcordes> > PostAcordes(TAcordes acordes)
        {
            _context.acordes.Add(acordes);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetAcordes", new { id = acordes.Id }, acordes));
        }
Exemple #2
0
        public async Task <IActionResult> PutAcordes(int id, TAcordes acordes)
        {
            if (id != acordes.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }