title: Android Repository Pattern convert room to domain model
body: <p>I am desperately looking for a possability to convert a room model to a domain model to enable offline functionality to my app. I have successfully implemented this pattern as described in this codelab: <a href="https://codelabs.developers.google.com/codelabs/kotlin-android-training-repository/#0" rel="nofollow noreferrer">https://codelabs.developers.google.com/codelabs/kotlin-android-training-repository/#0</a></p>
  <p>But I use in my domain model the Paging library -&gt; <code>PagedList&lt;com.trashmaster.muellmister.network.Place&gt;</code> and I need it to convert to <code>PagedList&lt;com.trashmaster.muellmister.data.Place&gt;</code> to insert data.
  <a href="https://i.stack.imgur.com/qXUeX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qXUeX.jpg" alt="enter image description here" /></a></p>
  <p>In my ViewModel on the other side I need (convert room model to network model.</p>
  <pre class="lang-kotlin prettyprint-override"><code>var properties: LiveData&lt;PagedList&lt;com.trashmaster.muellmister.network.Place&gt;&gt; (ViewModel)
  </code></pre>
  <p>Is there some kind best practices? Is it possible to merge network data model with room data model?</p>
  <p>Online functionality works flawlessly but implementing offline functionality with Paging datasource in combination is hard.</p>
  <p>Here is the path to my source</p>
  <p><a href="https://gist.github.com/DoomMortal/fa2c243d13d72a37988d12096cf8312a" rel="nofollow noreferrer">https://gist.github.com/DoomMortal/fa2c243d13d72a37988d12096cf8312a</a></p>
  <p>Any help would be appreciated.</p>
  <p>Thanks in advance</p>