Navigation:  USING THE API > 3.4 WORKING WITH PORTFOLIOS >

3.4.1 Example: Retrieving a List of Portfolios

Previous page Next page
  rev. 2007-12-04        

The following example shows how to retrieve a list of Portfolios from the Data Source “ManagingEnergy_Template”.

// Get the ManagingEnergy_Template Data Source

ManagingEnergy.Data.DataSource dataSource = api.GetDataSource("ManagingEnergy_Template");

 

// Get the list of portfolios contained withing the ManagingEnergy_Template data source

ManagingEnergy.Portfolio[] portfolios = dataSource.GetPorfolios(api);

 

// Display the list of portfolios

foreach (ManagingEnergy.Portfolio portfolio in portfolios)

  Console.WriteLine(portfolio);

 

// OUTPUT

Springfield

Trialuser_Direct EnergySpringfield



3.4.1_Example_Retrieving_a_Lis         ©2017 Managing Energy Inc.