title: Moq using ReturnsAsync and modify It.IsAny input parameter
body: <p>When using ReturnsAsync, we could only get it to return a new object. Is there a better / more correct way to write the code below?</p>
  
  <p>In this example, we have some sort of repository, and our implementation takes in an object of type Thing that has an Id (we want to pretend that our db set the Id) property:</p>
  
  <pre><code>var repo = new Mock&lt;IRepositoryOfThings&gt;();
  
  //Is there a better way to do this perhaps using ReturnsAsync??
  repo.Setup(r =&gt; r.Add(It.IsAny&lt;Thing&gt;())).Returns(
      (Thing x) =&gt;
      {
          var tcs = new TaskCompletionSource&lt;Thing&gt;();
          x.Id = Guid.NewGuid().ToString();
          tcs.SetResult(x);
          return tcs.Task;
      });
  </code></pre>
  
  <p>Thanks!</p>