public async Task <ActionResult> Put(int id, [FromBody] TrackerDetails value) { if (id != value.Id) { return(BadRequest()); } dbContext.Entry(value).State = EntityState.Modified; try { await dbContext.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TrackerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TrackerDetails> > Post([FromBody] TrackerDetails value) { dbContext.tbTracker.Add(value); await dbContext.SaveChangesAsync(); return(CreatedAtAction("GetTracker", new { id = value.Id }, value)); }