In Entity Framework 6.1, in a C# code-based migration (using System.Data.Entity.Migrations.DbMigration), when altering a stored procedure definition using the DbMigration.AlterStoredProcedure method, what's the proper syntax for adding or modifying a stored procedure parameter of the smallmoney
type (on SQL Server 2012)?
For example, if I have a migration method that modifies an existing SQL Server stored procedure which takes three parameters, of type int
, varchar
, and smallmoney
respectively:
public partial class MyCustomMigration : DbMigration
{
public override void Up()
{
this.AlterStoredProcedure("dbo.EditItem", c => new
{
ItemID = c.Int(),
ItemName = c.String(),
ItemCost = /* What goes here to represent the smallmoney SQL Server type? */
},
@" (New sproc body SQL goes here) ");
}
// ...
}
ItemCost = c.Decimal(storeType: "smallmoney")
... Actually you can use any method here e.g.c.Int()
orc.Double()
or anything until you explicitly specify thestoreType: "smallmoney"
– Koblas