示例#1
0
        public void CreateHotels()
        {
            var existing = entityRepository.Where(e => e.Name.StartsWith("Admin hotel -"))
                           .ToList();

            foreach (var e in existing)
            {
                removalService.RemoveEntity(e);
            }

            var regions = regionRepository
                          .Where(r => r.Hotels
                                 .Any(c => c.Owner.Name == "admin") == false)
                          .ToList();

            foreach (var region in regions)
            {
                var name  = $"Admin hotel - {region.Name}";
                var hotel = hotelService.BuildHotel(name, region, entityRepository.First(e => e.Name == "admin"));
                hotel.Entity.Equipment.ItemCapacity = 35_000;

                equipmentService.GiveItem(Entities.enums.ProductTypeEnum.ConstructionMaterials, 35_000, 1, hotel.Entity.Equipment);
                hotel.HotelPrice.PriceQ1 = 0.1m;
            }
        }