Exemple #1
0
        public async Task <ActionResult <OrgParti> > PostOrgParti(OrgParti orgParti)
        {
            _context.orgPartis.Add(orgParti);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetOrgParti", new { id = orgParti.Id }, orgParti));
        }
Exemple #2
0
        public async Task <IActionResult> PutOrgParti(int id, OrgParti orgParti)
        {
            if (id != orgParti.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }