Condividi tramite


Metodo DbMigration.DropPrimaryKey (String, Object)

[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]

Aggiunge un'operazione per eliminare una chiave primaria esistente creata con il nome predefinito. Le API di Entity Framework Migrations non sono progettate per accettare un input fornito da origini non attendibili, ad esempio l'utente finale di un'applicazione. Se viene accettato un input da tali origini, è necessario convalidarlo prima di passarlo alle API in modo da fornire protezione dagli attacchi SQL injection e da altri tipi di attacchi.

Spazio dei nomi:  System.Data.Entity.Migrations
Assembly:  EntityFramework (in EntityFramework.dll)

Sintassi

'Dichiarazione
<SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")> _
Protected Friend Sub DropPrimaryKey ( _
    table As String, _
    anonymousArguments As Object _
)
'Utilizzo
Dim table As String 
Dim anonymousArguments As Object 

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

Parametri

  • table
    Tipo: System.String
    Tabella che contiene la colonna di chiave primaria. Il nome dello schema è facoltativo. Se non si specifica uno schema, viene usato dbo.
  • anonymousArguments
    Tipo: System.Object
    Argomenti aggiuntivi che possono essere elaborati dai provider. Usare la sintassi del tipo anonimo per specificare argomenti, ad esempio ' new { SampleArgument = "MyValue" }'.

Vedere anche

Riferimento

DbMigration Classe

Overload DropPrimaryKey

Spazio dei nomi System.Data.Entity.Migrations