title: How to name anonymous type with string?
body: <p>So, I have some JavaScript:</p>
  
  <pre><code>var myThing = { userId: dataItem.UserID, permissionID: dataItem.PermissionID };
  </code></pre>
  
  <p>What I'd like, however, is to have this in C#:</p>
  
  <pre><code>var userIdHtmlId = '@nameof(MyDto.UserID)';
  var permissionIdHtmlId = '@nameof(MyDto.PermissionID)';
  </code></pre>
  
  <p>and then in JavaScript, somehow do something like this:</p>
  
  <pre><code>var userId = dataItem.GetValueByReflectionOrSomething(userIdHtmlId);
  var permissionID = dataItem.GetValueByReflectionOrSomething(permissionIdHtmlId);
  var myThing = { userId: userIdHtmlId, permissionID: permissionID };
  </code></pre>
  
  <p>...but have no idea how.</p>
  
  <p>Is this possible? How?</p>