public void OnGet(string id) { // Fetch selected house var house = _houseRepository.Read(id); this.House = new ViewModels.HouseViewModel(house); this.StageList = _stageRepository.List(house); this.stageNameList = new List <string>(); //stageNameList = this.StageList; for (int i = 0; i < this.StageList.Count; i++) { if (!this.stageNameList.Contains(this.StageList[i].StageName)) { this.stageNameList.Add(this.StageList[i].StageName); } } if (StageList.Any()) { this.Stage = StageList.First(); this.ImageList = _imageRepository.List(this.House.Object, this.Stage.StageName); } else { this.ImageList = new List <Image>(); } }
public void OnPostDelete(string id) { var house = _houseRepository.Read(id); _houseRepository.Delete(house); this.Houses = _houseRepository.List().Select(n => new ViewModels.HouseViewModel(n)).ToList(); }
public void OnGet(string id) { // Fetch selected house var house = _houseRepository.Read(id); this.House = new ViewModels.HouseViewModel(house); this.StageList = _stageRepository.List(house); if (StageList.Any()) { this.Stage = StageList.First(); this.ImageList = _imageRepository.List(this.House.Object, this.Stage.StageName); } else { this.ImageList = new List <Image>(); } }