Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to cast object of type 'System.Collections.Generic.List TO System.Collections.Generic.IList
    primarykey
    data
    text
    <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>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload