title: GET<TModel> NOT by primaryKEY
body: <p>I am using this function to query a table by its primary ID.</p>
  <pre><code> public virtual List&lt;TModel&gt; LoadAllWithChildren()
   {
       lock(Connection)
       {
           var result = LoadAll();
  
           foreach (var item in result)
           {
               try
               {
                   Connection.GetChildren(item);
               }
               catch (Exception e)
               {
                  DebugTraceListener.Instance.WriteLine(GetType().Name,
                       &quot;Can not load Child for itemType: &quot; + item.GetType().Name + &quot; reason: &quot; + e);
               }
           }
  
           return result;
       }
   }
  </code></pre>
  <p>But this always return results in regards to the primary key. The table I am querying on looks like this:</p>
  <p><a href="https://i.stack.imgur.com/dLeHg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dLeHg.png" alt="enter image description here" /></a></p>
  <p>So when I do this, I get all entries in this table (not just the ones you see in the picture, those are the ones that I want)</p>
  <p>So I did a small workaround:</p>
  <pre><code> var persistance = await Task.Run(() =&gt; PersistenceService.PresentationSequence.LoadAllWithChildren());
                   List&lt;PresentationSequence&gt; resSequence = new List&lt;PresentationSequence&gt;();
                   foreach(var elem in persistance)
                       if (elem.PresentationId == 166)
                           resSequence.Add(elem);
  </code></pre>
  <p>The result is the list as seen in the picture.</p>
  <p>This, however, is slow.</p>
  <p>Is there a way to use another SQlite function that will give me the list already filter for &quot;166&quot; in &quot;presentationID&quot;?</p>
  <p>(So no local work is done)</p>
  <p><strong>EDIT</strong>: I have tried using this function:</p>
  <pre><code>public virtual TModel LoadById(int id)
          {
              lock(Connection)
              {
                  try
                  {
                      var result = Connection.Get&lt;TModel&gt;(id);
                      return result;
                  }
                  catch (Exception ex)
                  {
                      DebugTraceListener.Instance.WriteLine(GetType().Name, $&quot;Cannot find item with ID: {id}\n\n{ex}&quot;);
                      return null;
                  }
              }
  }
  </code></pre>
  <p>But this will only take the primary key in. But I want to query for presentation ID and not get a single result from the ID column</p>