private void ExtractSpaces(IfcBuildingStorey storey, int floorId) { foreach (IfcSpace space in ((IfcBuildingStorey)storey).Spaces .Where(p => !p.GetType().IsSubclassOf(typeof(IfcFeatureElementSubtraction))) // Ignore Openings .OrderBy(o => o.GetType().Name)) { var dbSpace = _ifcSpaceService.CreateSpace(space, floorId); _spaceRepository.Create(dbSpace); } }
public void CreateSpace(int location) { if (location <= 0) { throw new ArgumentOutOfRangeException(nameof(location)); } if (!settings.SpaceCreationAllowed) { throw new InvalidOperationException("Space creation is not allowed."); } logger.Log($"Creating space {location}..."); if (spaceRepository.Read(location) != null) { throw new DuplicateSpaceException(); } spaceRepository.Create(new Space() { Location = location, Tenant = string.Empty, Packages = 0 }); }