BuildingModel IBuildingService.GetBuildingByLocation(decimal latitude, decimal longitude) { var buildings = this.dbContext.Building.WhereActiveAccessibleBuilding(b => b.Latitude == latitude && b.Longitude == longitude); var buildingModels = new BuildingModelMapping().Map(buildings).ToList(); this.LinkConsumptionWithBuilding(buildingModels); return(buildingModels.FirstOrDefault()); }
BuildingModel IBuildingService.GetBuildingByID(int buildingID) { var buildings = this.dbContext.Building.WhereActiveAccessibleBuilding(data => data.BuildingID == buildingID); var buildingModels = new BuildingModelMapping().Map(buildings).ToList(); this.LinkConsumptionWithBuilding(buildingModels); return(buildingModels.FirstOrDefault()); }