Jon Gallant

[object Object]

1 min read

Could not find an implementation of the query pattern for source type ‘[type]’. ‘Where’ not found. Consider explicitly specifying the type of the range variable ‘[variableName]’

You get this error if you try to do a LINQ query on a collection that doesn’t have an explicit type:

public interface ISubSection
{
string Title { get; set; }
string Description { get; set; }
IList Items { get; set; }
}
```text
```csharp
var x = from c in FailingBuilds.Items
```typescript
![Screenshot](/images/blog/3db7faf53f1b_5B45/image.png)
The simplest way to fix this (if you know the type at render time) is to cast the property to the concrete type in the LINQ statement: List<Build> below
```csharp
var x = from c in (List<Build>)FailingBuilds.Items
where c.Committers.Count() > 0
select c;

Jon

Share:
Share on X