コード例 #1
0
        public async Task <ActionResult <StoryboardDetail> > PostStoryboardDetail(StoryboardDetail StoryboardDetail)
        {
            _context.StoryboardDetails.Add(StoryboardDetail);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetStoryboardDetail", new { id = StoryboardDetail.SBId }, StoryboardDetail));
        }
コード例 #2
0
        public async Task <IActionResult> PutStoryboardDetail(int id, StoryboardDetail StoryboardDetail)
        {
            if (id != StoryboardDetail.SBId)
            {
                return(BadRequest());
            }
            _context.Entry(StoryboardDetail).State = EntityState.Modified;

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

            return(NoContent());
        }