public IActionResult Post([FromBody] Student obj) { if (ModelState.IsValid) { try { var res = db.AddDetail(obj); if (res != null) { return(Ok(res)); } return(NotFound()); } catch (Exception) { return(BadRequest()); } } return(BadRequest()); }