title: Compress List Data C# Web Service Send to Standalone Client with Delphi
body: <p>I have a .Net WebService and a standalone application written in DelphiXE2.</p>
  
  <p>When I submit a list with lots of items (400) the <code>FindAllEntity()</code> method is very slow.</p>
  
  <p>I researched compressing the data components of a list, but I only found Gzip C#, which is used for compressing files and image.</p>
  
  <p>Is there a way to compress a list of data that can be sent quickly to the standalone application?</p>
  
  <p>Here's the code:</p>
  
  <pre><code>//MyRegularNewEntity
      public class _MyEntity
      {
          public decimal id { get; set; }
          public _otherEntity Customers { get; set; }
          public string serial { get; set; }
          public decimal cost { get; set; }
      }
  
      //My Controller
      public IQueryable&lt;c#ModelEntity&gt; GetAllDatOfEntity()
      {
  
          IQueryable&lt;C#ModelEntity&gt; Dat;
          //The containt of data base entity is save in Dat ListQueryable
          Dat = db.MyEntity;
  
          return Dat;           
      }
  
      //My WebService
      [WebMethod]
      public List&lt;_MyRegularEntity&gt; FindAllEntity()
      {
          //Construct my repository
          MyRepository ag = new MyRepository();
          //Asign the result in a variable of call to get all the dat
          var Dat = ag. GetAllDatOfEntity();
          //Contruct the List with my entity to send for my client
          List&lt;_MyRegularEntity&gt; list = new List&lt;_MyRegularEntity&gt;();
          //Add all dat element to my list
          if (Dat != null)
          {
              foreach (var item in Dat)
              {
                 var MyEntity = new _MyRegularEntity();
                 MyEntity.id = item.id,
                 MyEntity.Custormers = new _otherEntity()
                 {
                     id=item.Customers.id,
                     firstname=item.Customers.firstname,
                     lastname=item.Custormers,lastname
                 },
                 MyEntity.Serial = item.Serial,
                 MyEntity.Cost = item.Cost
  
                 list.Add(MyEntity);
              };
  
           }
          //THIS IS THE RESULT I NEED COMPRESS
          return list;
      }
  </code></pre>