public string GetRoomType(int person_id) { try { return(RoomTypes.GetAll().Join( Agreements.GetAll(), r => r.id_type, a => a.room_id, (r, a) => new KeyValuePair <RoomType, Agreement>(r, a)) .Where(res => res.Value.person_id == person_id) .Select(res => res.Key.name).ToList().Last()); } catch { return("..."); } }