package Ġcom . golden hour . data . local . db Ċ Ċ import Ġandroidx . annotation . Worker Thread Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġcom . golden hour . data . model . db . Pin ned Location Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . with Context Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ /** Ċ Ġ* ĠPro viding ĠDatabase Ġhelper Ġof Ġaccessing Ġroom Ġdatabase Ġtables Ċ Ġ*/ Ċ @ Singleton Ċ class ĠApp Db Helper Ġ@ Inject Ċ constructor ( private Ġval Ġm App Database : ĠApp Database ) Ġ: ĠDb Helper Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠgetAll Location (): ĠLive Data < List < Pin ned Location >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġm App Database . location Dao (). load All () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġinsert Location ( pinned Location : ĠPin ned Location ) Ġ= ĊĠĠĠĠĠĠĠ Ġwith Context ( Dispatch ers . IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm App Database . location Dao (). insert ( pinned Location ) ĊĠĠĠĠĠĠĠ Ġ} Ċ } Ċ