Example #1
0
        public async Task <ActionResult <EliteRef> > PostEliteRef(EliteRef eliteRef)
        {
            _context.EliteRefs.Add(eliteRef);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEliteRef", new { id = eliteRef.Id }, eliteRef));
        }
Example #2
0
        public async Task <IActionResult> PutEliteRef(int id, EliteRef eliteRef)
        {
            if (id != eliteRef.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }