package Ġhex lay . mov ye ah . api . database . view _ models Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . lifecycle . Android ViewModel Ċ import Ġhex lay . mov ye ah . api . database . repositories . Db Movies Repository Ċ import Ġhex lay . mov ye ah . api . models . Movie Ċ Ċ class Ġ ĠDb Movie ViewModel ( application : ĠApplication ) Ġ: ĠAndroid ViewModel ( application ) Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġrepository Ġ= ĠDb Movies Repository ( application . application Context ) ĊĊĠĠĠ Ġfun Ġget Movies () Ġ= Ġrepository . get Movies () ĊĊĠĠĠ Ġfun Ġget Movie ( id : ĠInt ) Ġ= Ġrepository . get Movie ( id ) ĊĊĠĠĠ Ġfun Ġinsert Movie ( movie : ĠMovie ) Ġ= Ġrepository . insert Movie ( movie ) ĊĊĠĠĠ Ġfun Ġdelete Movie ( movie : ĠMovie ) Ġ= Ġrepository . delete Movie ( movie ) Ċ Ċ }