Beispiel #1
0
        public async Task <ActionResult <EliteData> > PostEliteData(EliteData eliteData)
        {
            _context.EliteDatas.Add(eliteData);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetEliteData), new { id = eliteData.Id }, eliteData));
        }
Beispiel #2
0
        public async Task <IActionResult> PutEliteData(int id, EliteData eliteData)
        {
            if (id != eliteData.Id)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException) when(!EliteDataExists(id))
            {
                return(NotFound());
            }

            return(NoContent());
        }