title: How can I get a list of entities from existing data with ServiceStack.OrmLite?
body: <p>I am using test data to run integration tests. So I am using the following method</p>
  
  <pre><code>public static IEnumerable&lt;ProductPhase&gt; GetProductPhases()
  {
      return new List&lt;ProductPhase&gt;
      {
          new ProductPhase { Id = "FirstPhase", Order = 1 },
          new ProductPhase { Id = "SecondPhase", Order = 2 },
          new ProductPhase { Id = "ThirdPhase", Order = 3 }, // ...
      }
  }
  
  [Test]
  public void MyTest()
  {
      using (var db = HostContext.TryResolve&lt;IDbConnectionFactory&gt;.OpenDbConnection())
      {
          db.DeleteAll&lt;ProductPhase&gt;();
          db.InsertAll(GetProductPhases());
      }
  
      // Do test stuff ...
  }
  </code></pre>
  
  <p>To validate completely my integration tests I need to be synchronized with data which is inserted in production. This data can contain dozens of lines and each time I need to refactor <code>GetProductPhases()</code> method manually, so I am near the <em>reality</em>.</p>
  
  <p>What I am looking for is a method to select existing SQL data to something that I can copy paste to <code>ProductPhase</code> object initializer.</p>
  
  <p>So, the ability to call something like:</p>
  
  <pre><code>db.Select&lt;ProductPhase&gt;().DumpList() // where db is connected to production server, so I can get actual values and it returns a string with new List&lt;ProductPhase&gt; { new ProductPhase { Id = "FirstPhase", Order = 1 }, new ProductPhase { Id = "SecondPhase", Order = 2 }, new ProductPhase { Id = "ThirdPhase", Order = 3 }, // ... }
  </code></pre>
  
  <p>Maybe there is a better method to do that, I don't know, I am open to alternatives.</p>
  
  <p>Thank you.</p>