title: Unable to cast object of type 'System.Collections.Generic.List TO System.Collections.Generic.IList
body: <p>I have the following code :</p>
  
  <pre><code> public class ComputeOperationData
  {
      public COUNTERS_DATA CounterData { get; set; }
      public COMPUTES_OPERATION ComputeOperation { get; set; }
      public COUNTERS_FORMULA CounterFormula { get; set; }
  
  }
  
  Public Function GetComputeOperationData(ByVal computeId As Integer, ByVal priodType As Integer, ByVal lstDuringTime As DuringTime) As IList(Of ComputeOperationData) Implements IComputeResultService.GetComputeOperationData
          Dim computeOperations As IQueryable(Of COMPUTES_OPERATION) = _repository.GetObjectQuery(Of COMPUTES_OPERATION).Include("COMPUTES").Include("COUNTERS")
          computeOperations = computeOperations.Where(Function(a) a.COMPUTE_ID = computeId)
  
          Dim countersFormula As IQueryable(Of COUNTERS_FORMULA) = _repository.GetObjectQuery(Of COUNTERS_FORMULA)().Include("COUNTERS")
  
          Dim countersData As IQueryable(Of DomainClasses.COUNTERS_DATA) = _repository.GetObjectQuery(Of DomainClasses.COUNTERS_DATA)().Include("COUNTERS")
          countersData = countersData.Where(Function(a) a.PERIOD_TYPE = priodType And a.COUNTER_DATE = lstDuringTime.StartDate And a.COUNTER_TIME &gt;= lstDuringTime.StartTime And a.COUNTER_TIME &lt;= lstDuringTime.EndTime)
  
                      Dim lstComputeOperationData = From counterData In countersData
                   Join computeOperation In computeOperations On counterData.COUNTER_ID Equals computeOperation.COUNTER_ID
                   Join counterFormula In countersFormula On counterData.COUNTER_ID Equals counterFormula.COUNTER_ID
                   Where counterData.COUNTER_DATE &gt;= counterFormula.FROM_DATE And counterData.COUNTER_DATE &lt;= counterFormula.TO_DATE
  
  
  
  
          Return lstComputeOperationData.ToList
  
      End Function
  </code></pre>
  
  <p>And I got this error  :</p>
  
  <blockquote>
    <p>Unable to cast object of type 'System.Data.Objects.ObjectQuery<code>1[VB$AnonymousType_1</code>3[Danesh.Ems.DomainClasses.COUNTERS_DATA,Danesh.Ems.DomainClasses.COMPUTES_OPERATION,Danesh.Ems.DomainClasses.COUNTERS_FORMULA]]' to type 'System.Collections.Generic.IList`1[Danesh.Ems.Models.ComputeOperationData]'</p>
  </blockquote>
  
  <p>please help me</p>