📅  最后修改于: 2022-03-11 14:49:07.189000             🧑  作者: Mango
var result = hotels.SelectMany(hotel => hotel.RoomType.Select(room => new { Id = room.RoomId, Hotel = hotel }))
.GroupBy(item => item.Id)
.Select(group => group.FirstOrDefault());