private static void ValidateDictToCount(int count)
        {
            Debug.Assert(dealVariantService.GetAll().Count() == count);
            Debug.Assert(districtService.GetAll().Count() == count);
            Debug.Assert(floorLevelService.GetAll().Count() == count);
            Debug.Assert(layoutService.GetAll().Count() == count);
            Debug.Assert(materialService.GetAll().Count() == count);
            Debug.Assert(ownershipService.GetAll().Count() == count);
            Debug.Assert(realtorService.GetAll().Count() == count);
            Debug.Assert(sewageService.GetAll().Count() == count);

            Debug.Assert(terraceService.GetAll().Count() == count);
            Debug.Assert(toiletTypeService.GetAll().Count() == count);
            Debug.Assert(waterSupplyService.GetAll().Count() == count);
        }
        public virtual void BeginEdit(T room)
        {
            District    = new ListCollectionView(_DistrictService.GetAll().ToList());
            Street      = new ListCollectionView((new[] { NullStreet }).ToList());
            Realtor     = new ListCollectionView(_RealtorService.GetAll().ToList());
            Ownership   = new ListCollectionView((new[] { NullOwnership }).Concat(_OwnershipService.GetAll()).ToList());
            DealVariant = new ListCollectionView((new[] { NullDealVariant }).Concat(_DealVariantService.GetAll()).ToList());
            Condition   = new ListCollectionView((new[] { NullCondition }).Concat(_ConditionService.GetAll()).ToList());
            InitCollection();

            DbEntity = room;
            UpdateValuesFromModel();

            District.CurrentChanged += (sender, args) => UpdateStreet();

            OkCommand.RaiseCanExecuteChanged();
            OpenDialog();
        }
        private void LoadFiltersData()
        {
            DistrictList    = null;
            StreetList      = null;
            RealtorList     = null;
            DealVariantList = null;
            OwnershipList   = null;

            DistrictList = new ObservableCollection <District>((new[] { _AllDistricts, _NoneDistricts }).Concat(
                                                                   _DistrictService.GetAll()).ToList());
            FilterDistrict = _AllDistricts;
            UpdateStreet();

            RealtorList =
                new ObservableCollection <Realtor>((new[] { _AllRealtors, _NoneRealtors }).Concat(_RealtorService.GetAll()).ToList());
            FilterRealtor = _AllRealtors;

            DealVariantList =
                new ObservableCollection <DealVariant>(
                    (new[] { _AllDealVariant, _NoneDealVariant }).Concat(_DealVariantService.GetAll()).ToList());
            FilterDealVariant = _AllDealVariant;

            OwnershipList =
                new ObservableCollection <Ownership>(
                    (new[] { _AllOwnership, _NoneOwnership }).Concat(_OwnershipService.GetAll()).ToList());
            FilterOwnership = _AllOwnership;

            TerraceList =
                new ObservableCollection <Terrace>(
                    (new[] { _AllTerrace, _ExistTerrace }).ToList());
            FilterTerrace = _AllTerrace;

            MinPrice = null;
            MaxPrice = null;

            LoadChildFiltersData();
        }