public async Task <ActionResult> CreateRoom(RoomCreateDto room) { if (await _roomRepo.RoomExists(room)) { return(StatusCode(400, new { Error = "Room already exists" })); } var _room = await _roomRepo.CreateRoom(room); return(_room == null ? StatusCode(500, new { Error = "Could not create room." }) : StatusCode(201, _room)); }