コード例 #1
0
        public async Task <IActionResult> PutStar(int id, Star star)
        {
            if (id != star.StarId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
 public async Task CreateStarAsync(StarDesc stardesc)
 {
     _context.StarDescs.Add(stardesc);
     await _context.SaveChangesAsync();
 }