title: Passing predicate as a parameter
body: <p>I am trying to get only a certain number of elements by passing a predicate as a parameters. But I am getting the following error:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type <code>System.Collections.Generic.IEnumerable &lt; Students.Entities&gt;</code> to <code>bool</code></p>
  </blockquote>
  
  <pre><code>var names = await Task.Run(() =&gt; Repository.GetWithNChildren(e =&gt; e.Entities.Take(offset)));
  
  
  public List&lt;T&gt; GetWithNChildren(Expression&lt;Func&lt;T, bool&gt;&gt; predicate = null)
  {
    var db = _factory.GetConnectionWithLock();
    using (db.Lock())
    {
        return db.GetAllWithChildren(predicate, true);
     }
   }
  </code></pre>
  
  <p><code>GetAllWithChildren</code> is a method in the SQLite Class</p>
  
  <pre><code>namespace SQLiteNetExtensions.Extensions
  {
      public static class ReadOperations
      {
          public static bool EnableRuntimeAssertions;
  
          public static T FindWithChildren&lt;T&gt;(this SQLiteConnection conn, object pk, bool recursive = false) where T : class;
          public static List&lt;T&gt; GetAllWithChildren&lt;T&gt;(this SQLiteConnection conn, Expression&lt;Func&lt;T, bool&gt;&gt; filter = null, bool recursive = false) where T : class;
          public static void GetChild&lt;T&gt;(this SQLiteConnection conn, T element, string relationshipProperty, bool recursive = false);
          public static void GetChild&lt;T&gt;(this SQLiteConnection conn, T element, Expression&lt;Func&lt;T, object&gt;&gt; propertyExpression, bool recursive = false);
          public static void GetChild&lt;T&gt;(this SQLiteConnection conn, T element, PropertyInfo relationshipProperty, bool recursive = false);
          public static void GetChildren&lt;T&gt;(this SQLiteConnection conn, T element, bool recursive = false);
          public static T GetWithChildren&lt;T&gt;(this SQLiteConnection conn, object pk, bool recursive = false) where T : class;
      }
  }
  </code></pre>