Exemple #1
0
        public async Task <ActionResult <TabpAntecedent> > PostTabpAntecedent(TabpAntecedent tabpAntecedent)
        {
            _context.TabpAntecedents.Add(tabpAntecedent);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTabpAntecedent", new { id = tabpAntecedent.AntcdnIdf }, tabpAntecedent));
        }
Exemple #2
0
        public async Task <IActionResult> PutTabpAntecedent(int id, TabpAntecedent tabpAntecedent)
        {
            if (id != tabpAntecedent.AntcdnIdf)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }