public ActionResult CreateAndConnect([FromBody] dynamic obj) { string roomJson = JsonConvert.SerializeObject(obj.Room); Room room = JsonConvert.DeserializeObject <Room>(roomJson); string roomsIdsJson = JsonConvert.SerializeObject(obj.ConnRooms); List <int> roomsIds = JsonConvert.DeserializeObject <List <int> >(roomsIdsJson); controlService.CreateRoom(room); controlService.ConnectRoomWithOthers(room.Id, roomsIds); return(StatusCode(201)); }