예제 #1
0
        public async Task <IActionResult> Putdocslevelpost(long id, docslevelpost docslevelpost)
        {
            if (id != docslevelpost.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult <docslevelpost> > Postdocslevelpost(docslevelpost docslevelpost)
        {
            _context.docslevelposts.Add(docslevelpost);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getdocslevelpost", new { id = docslevelpost.Id }, docslevelpost));
        }