public async Task <ActionResult> Post([FromBody] StudentsIdentity Student) { context.Add(Student); await context.SaveChangesAsync(); return(new CreatedAtRouteResult("Student", new { id = Student.id }, Student)); }
public async Task <ActionResult> Put(int id, [FromBody] StudentsIdentity Value) { if (id != Value.id) { return(BadRequest()); } context.Entry(Value).State = EntityState.Modified; await context.SaveChangesAsync(); return(Ok()); }