DbMigration.DropIndex 方法 (String, String, Object)

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]

添加基于索引名称删除索引的操作。 实体框架迁移 API 未被设计为接受不可信源(例如应用程序的最终用户)提供的输入。 如果接受来自此类源的输入,则应该首先对其进行验证,然后传递给这些 API,以便防止 SQL 注入攻击之类的威胁。

命名空间:  System.Data.Entity.Migrations
程序集:  EntityFramework(在 EntityFramework.dll 中)

语法

声明
<SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")> _
Protected Friend Sub DropIndex ( _
    table As String, _
    name As String, _
    anonymousArguments As Object _
)
用法
Dim table As String 
Dim name As String 
Dim anonymousArguments As Object 

Me.DropIndex(table, name, anonymousArguments)
[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void DropIndex(
    string table,
    string name,
    Object anonymousArguments
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1026:DefaultParametersShouldNotBeUsed")]
protected public:
void DropIndex(
    String^ table, 
    String^ name, 
    Object^ anonymousArguments
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")>]
member DropIndex : 
        table:string * 
        name:string * 
        anonymousArguments:Object -> unit
function DropIndex(
    table : String, 
    name : String, 
    anonymousArguments : Object
)

参数

  • table
    类型:System.String
    要从中删除索引的表的名称。 架构名称是可选的,如果未指定架构,则将假定 dbo。
  • anonymousArguments
    类型:System.Object
    提供程序可能会处理的其他参数。 使用匿名类型语法指定参数,例如“ new { SampleArgument = "MyValue" }”。

请参阅

参考

DbMigration 类

DropIndex 重载

System.Data.Entity.Migrations 命名空间