title: Fill table in Entity Framework Migration
body: <p>One of my EF migrations creates a table and as part of the migration <code>Up</code> method I would like to fill this table with initial data.</p>
  
  <p>Here's my migration class:</p>
  
  <pre><code>public partial class Objects : DbMigration
  {
      void Fill(string table, string path, string fieldTerminator = ",", string rowTerminator = @"\n")
      {
          Sql(string.Format("BULK INSERT {0} FROM '{1}' WITH (FIELDTERMINATOR = '{2}', ROWTERMINATOR = '{3}')", table, path, fieldTerminator, rowTerminator));
      }
  
      public override void Up()
      {
          CreateTable(
              "dbo.Objects",
              c =&gt; new
                  {
                      ObjectId = c.Int(nullable: false),
                      Name = c.String(),
                      Location_X = c.Double(nullable: false),
                      Location_Y = c.Double(nullable: false),
                      Location_Z = c.Double(nullable: false),
                  })
              .PrimaryKey(t =&gt; t.ObjectId);
  
          Fill("dbo.Objects", @"C:\temp\Scratch\Junk\ConsoleApplication3\data\objects.csv");
      }
  
      public override void Down()
      {
          DropTable("dbo.Objects");
      }
  }
  </code></pre>
  
  <p>This works correctly on my machine from the Package Manager Console. However I would like to use a relative path for the file so that the entire development team can use this easily. </p>
  
  <p>When I simply wrote the file name the update failed. When I tried concatenating the current directory to the file name I saw that the current directory was c:\windows\system32.</p>
  
  <p>How can I make the update run from the project or solution directory? </p>
  
  <p>Alternatively, is there a better way to fill the table during an update? I don't want to use the <code>Seed</code> method becasue it doesn't do exactly what I want. For instance, there's only a single <code>Seed</code> method while I want to write different code for different migrations.</p>