title: Stackoverflowexception on returning list<object>
body: <p>I am trying to doing an fetch call to retrieve a list of objects and just print its content for now. when the call is made a 502.3 error and stackoverflowexception error happens on the return call. See code below</p>
  
  <pre><code>[HttpGet("[action]")]
      public async Task&lt;List&lt;Portfolio&gt;&gt; GetAllPortfolios()
      {
          var portfolios = await _portfolioService.GetAllPortfolios().ConfigureAwait(false);
          return portfolios;
      }
  </code></pre>
  
  <p>I tried to return an empty list and that ran fine with 200 status. </p>
  
  <p>Here is my code for the call to the server to retrieve the data</p>
  
  <pre><code>public async Task&lt;List&lt;Portfolio&gt;&gt; GetAllPortfolios()
      {
          List&lt;Portfolio&gt; PortfolioList = new List&lt;Portfolio&gt;();
          Portfolio portfolio;
          using (SqlConnection conn = new SqlConnection(Connection))
          {
              SqlCommand command = new SqlCommand();
              command.Connection = conn;
              command.CommandType = CommandType.StoredProcedure;
              command.CommandText = "USP_Get_All_Portfolios";
              conn.Open();
              SqlDataReader reader = await command.ExecuteReaderAsync().ConfigureAwait(false);
  
              //Fields to be populated
              string PortfolioName, Description, CreateID, UpdateID;
  
              while (await reader.ReadAsync().ConfigureAwait(false))
              {
                  PortfolioName = reader["Portfolio_Name"].ToString();
                  Description = reader["Long_Description"].ToString();
                  CreateID = reader["Create_ID"].ToString();
                  UpdateID = reader["Update_ID"].ToString();
                  portfolio = new Portfolio(PortfolioName, Description, CreateID, UpdateID);
                  PortfolioList.Add(portfolio);
              }
              reader.Close();
          }
  
          return PortfolioList;
      }
  </code></pre>
  
  <p>Code for my PortfolioService</p>
  
  <pre><code>public class PortfolioService : IPortfolioService
  {
      private readonly IPortfolioRepository _portfolioRepository;
  
      public PortfolioService(IPortfolioRepository portfolioRepository)
      {
          _portfolioRepository = portfolioRepository;
      }
      public async Task&lt;bool&gt; CreatePortfolio(Portfolio portfolio)
      {
          return await _portfolioRepository.CreatePortfolio(portfolio).ConfigureAwait(false);
      }
  
      public async Task&lt;List&lt;Portfolio&gt;&gt; GetAllPortfolios()
      {
          return await _portfolioRepository.GetAllPortfolios().ConfigureAwait(false);
      }
  }
  </code></pre>
  
  <p>Code for my Portfolio class</p>
  
  <pre><code>public class Portfolio
  {
      private string mPortfolioName;
      private string mDescription;
      private string mCreateID;
      private string mUpdateID;
  
      public string PortfolioName
      {
          get { return mPortfolioName; }
          set { mPortfolioName = value; }
      }
  
      public string Description
      {
          get { return Description; }
          set { mDescription = value; }
      }
  
      public string CreateID
      {
          get { return mCreateID; }
          set { mCreateID = value; }
      }
  
      public string UpdateID
      {
          get { return UpdateID; }
          set { mUpdateID = value; }
      }
  
      public Portfolio(string portfolioName, string description, string createID, string updateID)
      {
          mPortfolioName = portfolioName;
          mDescription = description;
          mCreateID = createID;
          mUpdateID = updateID;
      }
  }
  </code></pre>