title: Update database entry in Room using WorkManager
body: <p>I am trying to use <code>WorkManager</code> in Android because till now I have done my insert updates using <code>AsyncTask</code>. 
  I'm trying to update user in <code>Room database</code>. I have created a class in <code>Repository</code> to do the process in background but I don't know if this is the right way to code. Also I am a bit confused how to call the method in userViewModel.</p>
  
  <p>Here is my code:</p>
  
  <p>In Repository:</p>
  
  <pre><code>inner class Test(ctx: Context, params: WorkerParameters) : Worker(ctx, params) {
  
      override fun doWork(): Result {
          fun updateUser(userId : Int , userName :String , userLastname: String){
              userDao.updateUser(userId, userName, userLastname)
          }
          return Result.success()
      }
  }
  </code></pre>
  
  <p>And in viewModel:</p>
  
  <pre><code>private val workManager: WorkManager = WorkManager.getInstance()
  fun updateUser(userID: Int, userName: String, userLastname: String)    {
      workManager.enqueue(OneTimeWorkRequest.from(Repository.Test::class.java))
  
  }
  </code></pre>
  
  <p>Maybe this is not the right way to use WorkManager so I would appreciate it if anyone can help me.</p>