public async Task <IActionResult> Post([FromBody] Category category) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _context.AddAsync(category); return(CreatedAtAction(nameof(GetById), new { id = category.ID }, category)); }
public async Task AddAsync(Player player) { await _context.AddAsync(player); await _context.SaveChangesAsync(); }