public async Task SaveSingleRepairToDatabase(ArchitecturesNeedRepairModel architecturesNeedRepairModel)
        {
            var repair = new RepairModel
            {
                ArchitectureId  = architecturesNeedRepairModel.ArchitectureId,
                RestorationCost = architecturesNeedRepairModel.RepairCost,
                RestorationKind = architecturesNeedRepairModel.RestorationKind,
                RestorationDate = new DateTime(2500, 1, 1)
            };

            await SaveSingleRepairToDatabase(repair);
        }
        private async Task <List <ArchitecturesNeedRepairModel> > LoadCombinations()
        {
            _architectures = (await _architecturesManager.GetArchitectures()).ToList();
            _restorations  = (await _restorationsManager.GetRestorations()).ToList();

            var needRestorationList = _architectures
                                      .Where(a => a.State == State.Bad || a.State == State.Awful)
                                      .Select(arch => new ArchitecturesNeedRepairModel
            {
                ArchitectureId    = arch.Id,
                ArchitectureTitle = arch.Title,
                ArchitectureState = arch.State,
                Volume            = arch.Height * arch.Square
            }).ToList();

            var tmpList = new List <ArchitecturesNeedRepairModel>();

            foreach (var rest in _restorationKindsList)
            {
                var restoration = await _restorationsManager.GetRestorationByRestorationKind(rest);

                if (restoration == null)
                {
                    continue;
                }

                foreach (var arch in needRestorationList)
                {
                    var archi       = _architectures.Find(x => x.Id == arch.ArchitectureId);
                    var archRepairs = archi.Repairs.Where(x => x.RestorationDate > DateTime.Now);
                    if (archRepairs.Any(x => x.RestorationKind == rest))
                    {
                        continue;
                    }

                    ArchitecturesNeedRepairModel architecture = new ArchitecturesNeedRepairModel();
                    arch.Clone(architecture);

                    architecture.ArchitectureId  = arch.ArchitectureId;
                    architecture.RepairCost      = Convert.ToInt32(restoration.Outlays * arch.Volume);
                    architecture.RestorationKind = rest;

                    tmpList.Add(architecture);
                }
            }

            return(_repairsList = tmpList);
        }