public HttpResponseMessage UpdateEndTime([FromBody] dynamic endTimeDetails) { int presenceId = endTimeDetails["presenceId"]; DateTime endTime = endTimeDetails["endTime"]; return((LogicUser.UpdateEndTime(presenceId, endTime)) ? new HttpResponseMessage(HttpStatusCode.OK) : new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new ObjectContent <String>("Can not update in DB", new JsonMediaTypeFormatter()) }); }