title: Asp.Net Core - Bind a model's property to a different named value
body: <p>I have the following situation.
  I have implemented OData, and I'm using $filter like this: <code>$filter=Name eq 'test.txt'</code></p>
  
  <p>What I want to do is, use aliases for the fileds in files. For example i want the query <code>$filter=name eq 'test.txt'</code> to be also valid. 
  Currently when I try this, Im getting this error: <code>Could not find a property named 'name' on type 'My.App.DataAccess.Model.File</code></p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public class File 
  {
      public long Size { get; set; }
      public Guid Id { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public async Task&lt;IActionResult&gt; GetFiles(,
  [FromQuery]ODataQueryParameters parameters)
  {
      var modelManager = (IODataModelManger)HttpContext.RequestServices.GetService(typeof(IODataModelManger));
      var model = modelManager.GetModel(nameof(My.App));
      var queryContext = new ODataQueryContext(model, typeof(File), null);
      var queryOptions = new ODataQueryOptions(queryContext, HttpContext.Request, Provider);
  
      var result = await FileService.GetFilesM(queryOptions);
  
      return Json(result);
  }
  </code></pre>
  
  <p>I've found this interesting page: <a href="https://ole.michelsen.dk/blog/bind-a-model-property-to-a-different-named-query-string-field.html" rel="nofollow noreferrer">https://ole.michelsen.dk/blog/bind-a-model-property-to-a-different-named-query-string-field.html</a> , but I just couldn't adapt this to my needs, its to old. </p>
  
  <p>Does anyone know how to bind a model property to a different named query string field?</p>