No CreateStoredProcedure method on Entity Framework Core

asp.net-core c# entity-framework-core

Question

I want to create stored procedure using Migration Builder but there is no

CreateStoredProcedure

method in Migration class like this.

public override void Up() 
{
  CreateStoredProcedure(
    "MyStoredProcedure",
    p => new
    {
        id = p.Int()
    },
    @"SELECT some-data FROM my-table WHERE id = @id"
  );
}

public override void Down() 
{
  DropStoredProcedure("MyStoredProcedure");
}

How to Create Stored procedure in Migration using Entity Framework Core?

1
5
7/6/2016 12:01:56 PM

Accepted Answer

Use can use the migrationBuilder.Sql() method to execute arbitrary SQL in migrations with EF Core

8
7/7/2016 8:12:03 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow