title: Getting ObjectBox to work with LiveData and Kotlin
body: <p>I have some working code that uses Room, where I have a function in my repository that looks like this:</p>
  
  <pre><code>fun getCharacters(context: Context): LiveData&lt;List&lt;CharacterEntity&gt;&gt; {
      return db.characterDAO().getAll()
  }
  </code></pre>
  
  <p>And my ViewModel simply look like this (just returning the LiveData):</p>
  
  <pre><code>class CharactersViewModel(application: Application) : AndroidViewModel(application) {
  
  val characters = RickAndMortyRepository.getInstance(application).getCharacters(application)
  
  }
  </code></pre>
  
  <p>Now I would like to convert this to use ObjectBox instead to test it out, but I can not wrap my head around it... I tried altering my repository methos to this:</p>
  
  <pre><code>fun getCharacters(context: Context): ObjectBoxLiveData&lt;List&lt;Character&gt;&gt; {
      val characters = ObjectBox.boxStore.boxFor(Character::class.java)
      return ObjectBoxLiveData&lt;List&lt;Character&gt;&gt;(characters.query().build())
      //return db.characterDAO().getAll()
  }
  </code></pre>
  
  <p>But there is a type mismatch as the query return "ObjectBoxLiveData and not a list... But I am trying to query for all the Character objects/documents, but how on earth should I build this?</p>
  
  <p>Thank you<br>
  Søren</p>