package Ġcom . sek th d roid . mar vel . data . room Ċ Ċ import Ġcom . sek th d roid . mar vel . domain . models . Mar vel Character Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ internal Ġclass ĠRoom Datasource Ġ@ Inject Ġconstructor ( private Ġval Ġcharacters Dao : ĠChar acters Dao ) Ġ{ ĊĠĠĠ Ġsuspend Ġfun Ġinsert ( var arg Ġcharacter : ĠMar vel Character ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcharacter . forEach Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcharacters Dao . insert All ( it . to Entity ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcharacters Dao . insert All (* it . to Resources Entity (). to Typed Array ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġget (): ĠList < Mar vel Character > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcharacters Dao . getAll () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġit . to Mar vel Character () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġget ( id : ĠString ): ĠMar vel Character ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcharacters Dao . get ( id )?. to Mar vel Character () ĊĠĠĠ Ġ} Ċ } Ċ