The following example shows how to retrieve the list of facilities which are contained in the “Springfield” Portfolio (which has ID 01) within the Data Source “ManagingEnergy_Template”.
// Get the "Springfield" Portfolio (ID "01") from the Data Source "ManagingEnergy Template" ManagingEnergy.Portfolio portfolio = api.PortfolioManager.GetPortfolio("ManagingEnergy_Template", "01");
// Get the list of Facilities contained in the portfolio ManagingEnergy.Facility[] facilities = portfolio.GetFacilities(api);
// display the facilities foreach (ManagingEnergy.Facility facility in facilities) Console.WriteLine(facility);
// OUTPUT 0016 - Springfield Municipal Offices 1001 - Springfield General Hospital 2001 - Springfield Science Museum 7014 - Springfield Arena 7023 - Springfield Recreational Centre 8001 - Springfield Police Detachment 8024 - Springfield Correctional Centre 9001 - Springfield Residential Co-op |