public BuildingManagementHostedService(BuildingService buildingService, LoggerService loggerService) { _buildingHosteds = new Dictionary <ObjectId, BuildingHosted>(); _buildingService = buildingService; _loggerService = loggerService; var buildings = _buildingService.GetAll().Where(x => x.Status != BuildingStatus.Inactive); foreach (var building in buildings) { var buildingHosted = new BuildingHosted(building, buildingService); _buildingHosteds.Add(building.Id, buildingHosted); } BuildingService.UpdateBuildingEvent += UpdateBuildingHandler; }
void Start() { buildingService = new BuildingService(); buildings = buildingService.GetAll(); }
public async Task <ActionResult <IEnumerable <Building> > > GetBuilding() { return(await _buildingService.GetAll()); }