title: Use IEnumerable<Expression<Func<T, Object>>> in method
body: <p>I have the following method:</p>
  
  <pre><code>public void Update&lt;T&gt;(T entity, IEnumerable&lt;Expression&lt;Func&lt;T, Object&gt;&gt;&gt; properties)  
      where T : class 
  {
      _context.Set&lt;T&gt;().Attach(entity);
  
      foreach (var property in properties)
          _context.Entry&lt;T&gt;(entity)
              .Property(((MemberExpression)property.Body).Member.Name)
              .IsModified = true;
  
  } // Update
  </code></pre>
  
  <p>I am passing an Entity Framework entity, attaching it and Set each property as modified.</p>
  
  <p>I would like to use it as follows:</p>
  
  <pre><code>_repository.Update&lt;File&gt;(file, new { x =&gt; x.Data, x =&gt; x.Name });
  </code></pre>
  
  <p>So I am passing a file and saying the Data and Name properties were modified.</p>
  
  <p>But I am getting the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>The best overloaded method match for 'Update&lt;File&gt;(File,
  IEnumerable&lt;System.Linq.Expressions.Expression&lt;System.Func&lt;File,Object&gt;&gt;&gt;)' 
  has some invalid arguments
  </code></pre>
  
  <p>How should I change my method to be able to use it as I mentioned? </p>
  
  <p>Or maybe:</p>
  
  <pre><code>_repository.Update&lt;File&gt;(file, x =&gt; x.Data, x =&gt; x.Name);
  </code></pre>
  
  <p>Or even:</p>
  
  <pre><code>_repository.Update&lt;File&gt;(file, x =&gt; new { x.Data, x.Name });
  </code></pre>