Exemple #1
0
        public async Task <ActionResult <MCAttributes> > PostMCAttributes(MCAttributes mCAttributes)
        {
            _context.MCAttributes.Add(mCAttributes);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMCAttributes", new { id = mCAttributes.Id }, mCAttributes));
        }
Exemple #2
0
        public async Task <IActionResult> PutMCAttributes(int id, MCAttributes mCAttributes)
        {
            if (id != mCAttributes.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }