DbMigration.MoveStoredProcedure 方法
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
添加将存储过程移至新架构的操作。 实体框架迁移 API 未被设计为接受不可信源(例如应用程序的最终用户)提供的输入。 如果接受来自此类源的输入,则应该首先对其进行验证,然后传递给这些 API,以便防止 SQL 注入攻击之类的威胁。
命名空间: System.Data.Entity.Migrations
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
<SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")> _
Protected Friend Sub MoveStoredProcedure ( _
name As String, _
newSchema As String, _
anonymousArguments As Object _
)
用法
Dim name As String
Dim newSchema As String
Dim anonymousArguments As Object
Me.MoveStoredProcedure(name, newSchema, _
anonymousArguments)
[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void MoveStoredProcedure(
string name,
string newSchema,
Object anonymousArguments
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1026:DefaultParametersShouldNotBeUsed")]
protected public:
void MoveStoredProcedure(
String^ name,
String^ newSchema,
Object^ anonymousArguments
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")>]
member MoveStoredProcedure :
name:string *
newSchema:string *
anonymousArguments:Object -> unit
function MoveStoredProcedure(
name : String,
newSchema : String,
anonymousArguments : Object
)
参数
- name
类型:System.String
要移动的存储过程的名称。 架构名称是可选的,如果未指定架构,则将假定 dbo。
- newSchema
类型:System.String
要将存储过程移到其中的架构。
- anonymousArguments
类型:System.Object
提供程序可能会处理的其他参数。 使用匿名类型语法指定参数,例如“ new { SampleArgument = "MyValue" }”。