public IActionResult Post([FromBody] Trainings trainings) { if (ModelState.IsValid) { bool result = mentorrepository.AddTraining(trainings); if (result) { return(Created("Add Training", trainings.Id)); } return(StatusCode(StatusCodes.Status500InternalServerError)); } return(BadRequest(ModelState)); }