package Ġcom . came ll on case . test ede performance 0 3 . repository Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġcom . came ll on case . test ede performance 0 3 . database . Survey Ċ import Ġcom . came ll on case . test ede performance 0 3 . database . Survey or Ċ import Ġcom . came ll on case . test ede performance 0 3 . database . Sur veys Dao Ċ Ċ class ĠSurvey Repository ( private Ġval Ġsur veys Dao : ĠSur veys Dao ) Ġ{ ĊĊĠĠĠ Ġval Ġall Sur veys : ĠLive Data < List < Survey >> Ġ= Ġsur veys Dao . getAll Sur veys () ĊĊĠĠĠ Ġsuspend Ġfun Ġinsert ( survey : ĠSurvey ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsur veys Dao . insert ( survey ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġinsert Survey or ( survey or : ĠSur veyor ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsur veys Dao . insert Survey or ( survey or ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġdelete ( survey : ĠSurvey ){ ĊĠĠĠĠĠĠĠ Ġsur veys Dao . delete ( survey ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Survey ById ( survey Id : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsur veys Dao . get Survey ById ( survey Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Survey or ById ( survey or Id : ĠString ): ĠSur veyor ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsur veys Dao . get Survey or ById ( survey or Id ). value ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠgetAll Sur veys By Survey or Id ( survey or Id : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsur veys Dao . getAll Sur veys By Survey or Id ( survey or Id ) ĊĠĠĠ Ġ} Ċ } Ċ