title: EF 4.3 Code Migrations with CreateIndex and Anonymous Arguments
body: <p>I am trying to create an index using EF Code Migrations. The index looks something like:</p>
  
  <pre><code>CREATE INDEX [IX_RatingId_CreatedAt] ON [Users] 
  (
  [RatingId] ASC,
  [CreatedAt] ASC
  )
  INCLUDE (Id, Email, DomainId)
  </code></pre>
  
  <p>The code I have so far is:</p>
  
  <pre><code>CreateIndex("Users",
               new string[] { "RatingId", "CreatedAt" },
               false,
               "IX_RatingId_CreatedAt"
             );
  </code></pre>
  
  <p>This will create the index for me but it will not include the columns. The CreateIndex method has an override that takes something called anonymousArguments. I can't really find that much information about it so I tried something like:</p>
  
  <pre><code>CreateIndex("Users",
               new string[] { "RatingId", "CreatedAt" },
               false,
               "IX_RatingId_CreatedAt",
               new { INCLUDE = "(Id, Email, DomainId)" });
  </code></pre>
  
  <p>There was no exception but it didn't work.</p>
  
  <p>Is it possible to create the above index using the CreateIndex method or do I have to use the Sql method to write out the T-SQL in my migration? How do one use anonymous arguments correctly?</p>