/// <summary>Loads this instance.</summary> public void Load() { var areaRepository = new RelationalRepository <AreaRecord>(); // @@@ TODO: Fix hack: http://www.wheelmud.net/tabid/59/aft/1622/Default.aspx string areaNumber = this.Parent.Id.Replace("area/", string.Empty); long persistedAreaID = long.Parse(areaNumber); ICollection <RoomRecord> rooms = areaRepository.GetRoomsForArea(persistedAreaID); foreach (var roomRecord in rooms) { // @@@ TODO: Fix hack: http://www.wheelmud.net/tabid/59/aft/1622/Default.aspx var roomBehavior = new RoomBehavior() { ID = roomRecord.ID, }; var currRoom = new Thing(roomBehavior) { Name = roomRecord.Name, Description = roomRecord.Description, Id = "room/" + roomRecord.ID, }; // Load this room and it's children. roomBehavior.Load(); this.Parent.Add(currRoom); } }
/// <summary>Loads this instance.</summary> public void Load() { var areaRepository = new RelationalRepository <AreaRecord>(); string areaNumber = this.Parent.Id.Replace("area/", string.Empty); long persistedAreaID = long.Parse(areaNumber); ICollection <RoomRecord> rooms = areaRepository.GetRoomsForArea(persistedAreaID); foreach (var roomRecord in rooms) { var roomBehavior = new RoomBehavior() { ID = roomRecord.ID, }; var currRoom = new Thing(roomBehavior) { Name = roomRecord.Name, Description = roomRecord.Description, Id = "room/" + roomRecord.ID, }; // Load this room and it's children. roomBehavior.Load(); this.Parent.Add(currRoom); } }