title: Having The method or operation is not implemented when calling Count in IQueryable
body: <p>I have a linq query using MySql Connector .NET v6.8.3 like this:</p>
  
  <pre><code>var query = from c in context.Containers
                              where c.isActive &amp;&amp; !c.isDeleted
                              join pc in context.PublishedContainers on c.id_container equals pc.id_container
                              where pc.id_website == _siteId &amp;&amp; pc.is_active &amp;&amp; pc.is_visible &amp;&amp; pc.is_revised == 9 //9 = revised
                              where pc.PublishedContainerProviders.Any()
                              where pc.PublishedContainerPresentations.Any(pcp =&gt; pcp.Presentation.PresentationServiceInfoes.SelectMany(psi =&gt; psi.PresentationServiceInfoLocations.Where(l =&gt; !string.IsNullOrEmpty(l.Location.googlemap))).Any())
                              select c;
  </code></pre>
  
  <p>and when i call <code>query.Count()</code> i'm getting <code>The method or operation is not implemented</code> exception and i dont know why..</p>
  
  <p>What's going on?</p>
  
  <p><strong>Edit</strong>:
  If i call the <code>ToList()</code> method i have the same exception.</p>
  
  <p><strong>Edit 2</strong>:
  Exception: </p>
  
  <pre><code>`An error occurred while preparing the command definition. See the inner exception for details.`
  </code></pre>
  
  <p>StackTrace:</p>
  
  <pre><code>at System.Data.EntityClient.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree)
     at System.Data.EntityClient.EntityProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
     at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Prepare(ObjectContext context, DbQueryCommandTree tree, Type elementType, MergeOption mergeOption, Span span, ReadOnlyCollection`1 compiledQueryParameters, AliasGenerator aliasGenerator)
     at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
     at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
     at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator()
     at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
     at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
  </code></pre>
  
  <p>Inner Exception: <code>The method or operation is not implemented.</code>
  StackTrace:</p>
  
  <pre><code>   at MySql.Data.Entity.SelectStatement.Accept(SqlFragmentVisitor visitor)
     at MySql.Data.Entity.ExistsFragment.Accept(SqlFragmentVisitor visitor)
     at MySql.Data.Entity.BinaryFragment.Accept(SqlFragmentVisitor visitor)
     at MySql.Data.Entity.SqlGenerator.FuseSelectWithInnerSelect(SelectStatement outer, SelectStatement inner)
     at MySql.Data.Entity.SqlGenerator.VisitInputExpression(DbExpression e, String name, TypeUsage type)
     at MySql.Data.Entity.SelectGenerator.VisitInputExpressionEnsureSelect(DbExpression e, String name, TypeUsage type)
     at MySql.Data.Entity.SelectGenerator.Visit(DbProjectExpression expression)
     at MySql.Data.Entity.SqlGenerator.Visit(DbIsEmptyExpression expression)
     at MySql.Data.Entity.SqlGenerator.Visit(DbNotExpression expression)
     at MySql.Data.Entity.SqlGenerator.VisitBinaryExpression(DbExpression left, DbExpression right, String op)
     at MySql.Data.Entity.SelectGenerator.Visit(DbFilterExpression expression)
     at MySql.Data.Entity.SqlGenerator.VisitInputExpression(DbExpression e, String name, TypeUsage type)
     at MySql.Data.Entity.SelectGenerator.VisitInputExpressionEnsureSelect(DbExpression e, String name, TypeUsage type)
     at MySql.Data.Entity.SelectGenerator.Visit(DbGroupByExpression expression)
     at MySql.Data.Entity.SqlGenerator.VisitInputExpression(DbExpression e, String name, TypeUsage type)
     at MySql.Data.Entity.SelectGenerator.VisitInputExpressionEnsureSelect(DbExpression e, String name, TypeUsage type)
     at MySql.Data.Entity.SelectGenerator.Visit(DbProjectExpression expression)
     at MySql.Data.Entity.SelectGenerator.GenerateSQL(DbCommandTree tree)
     at MySql.Data.MySqlClient.MySqlProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
     at System.Data.EntityClient.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree)
  </code></pre>
  
  <p>Edit 3:
  I just figured out that the problem is this line:</p>
  
  <pre><code>where pc.PublishedContainerPresentations.Any(pcp =&gt; pcp.Presentation.PresentationServiceInfoes.SelectMany(psi =&gt; psi.PresentationServiceInfoLocations.Where(l =&gt; !string.IsNullOrEmpty(l.Location.googlemap))).Any())
  </code></pre>