package Ġcom . android . sample . core . repository Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . android . sample . common . base . Base List Repository Ċ import Ġcom . android . sample . core . database . Dis ney Dao Ċ import Ġcom . android . sample . core . database . as Domain Model Ċ import Ġcom . android . sample . core . di . Io Dispatcher Ċ import Ġcom . android . sample . core . network . Dis ney Service Ċ import Ġcom . android . sample . core . response . Post er Ċ import Ġcom . android . sample . core . response . as Database Model Ċ import Ġkotlinx . coroutines . Coroutine Dispatcher Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ class ĠDis ney Repository Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġdao : ĠDis ney Dao , ĊĠĠĠ Ġprivate Ġval Ġapi : ĠDis ney Service , ĊĠĠĠ Ġcontext : ĠContext , ĊĠĠĠ Ġ@ Io Dispatcher Ġcor outines Dispatcher : ĠCor outine Dispatcher Ċ ) Ġ: ĠBase List Repository < Post er >( ĊĠĠĠ Ġcontext , ĊĠĠĠ Ġcor outines Dispatcher Ċ ) Ġ{ ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġquery (): ĠList < Post er > Ġ= Ġdao . getPost ers (). as Domain Model () ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġfetch (): ĠList < Post er > Ġ= Ġapi . fetch Dis ney Post er List () ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġsave Fetch Result ( items : ĠList < Post er >) Ġ{ ĊĠĠĠĠĠĠĠ Ġdao . insert All (* items . as Database Model ()) ĊĠĠĠ Ġ} Ċ }