public async Task <ActionResult> CreateEntity(int teacherId, int subjectId, [FromBody] ClassDTO classDto) { //if (HttpContext.Request.ContentType != "application/json") // return StatusCode(415); try { ClassDTO created = await _classService.CreateEntity(teacherId, subjectId, classDto); return(Ok(created)); } catch (Exception e) { return(BadRequest(e.Message)); } }