public async Task <IActionResult> CreateUpdate(Student student) //([FromBody] Student student) { if (student == null) //|| !ModelState.IsValid { //return BadRequest(ErrorCode.ObjectIsNotValid.ToString()); return(BadRequest(student)); } try { _context.ApplyChanges(student); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { return(BadRequest(ErrorCode.CouldNotUpdateObject.ToString())); } catch (Exception) { return(BadRequest(ErrorCode.CouldNotCreateObject.ToString())); } //return CreatedAtAction(nameof(GetById), new { id = student.Id }, student); return(CreatedAtRoute("GetStudent", new { id = student.Id }, student)); //return Ok(student); }