Esempio n. 1
0
        public async Task <ActionResult <TopEarners> > PostTopEarners(TopEarners TopEarner)
        {
            _context.TopEarner.Add(TopEarner);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetTopEarners), new { id = TopEarner.Id }, TopEarner));
        }
Esempio n. 2
0
        public async Task <IActionResult> PutTopEarner(long id, TopEarners earners)
        {
            if (id != earners.Id)
            {
                return(BadRequest());
            }
            _context.Entry(earners).State = EntityState.Modified;

            await _context.SaveChangesAsync();

            return(NoContent());
        }