DbMigration.AlterStoredProcedure<TParameters> Method (String, Func<ParameterBuilder, TParameters>, String, Object)

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Adds an operation to alter a stored procedure. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

Namespace:  System.Data.Entity.Migrations
Assembly:  EntityFramework (in EntityFramework.dll)

Syntax

'Declaration
<SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")> _
Public Sub AlterStoredProcedure(Of TParameters) ( _
    name As String, _
    parametersAction As Func(Of ParameterBuilder, TParameters), _
    body As String, _
    anonymousArguments As Object _
)
'Usage
Dim instance As DbMigration 
Dim name As String 
Dim parametersAction As Func(Of ParameterBuilder, TParameters)
Dim body As String 
Dim anonymousArguments As Object

instance.AlterStoredProcedure(name, parametersAction, _
    body, anonymousArguments)
[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
public void AlterStoredProcedure<TParameters>(
    string name,
    Func<ParameterBuilder, TParameters> parametersAction,
    string body,
    Object anonymousArguments
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1026:DefaultParametersShouldNotBeUsed")]
public:
generic<typename TParameters>
void AlterStoredProcedure(
    String^ name, 
    Func<ParameterBuilder^, TParameters>^ parametersAction, 
    String^ body, 
    Object^ anonymousArguments
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")>]
member AlterStoredProcedure : 
        name:string * 
        parametersAction:Func<ParameterBuilder, 'TParameters> * 
        body:string * 
        anonymousArguments:Object -> unit
JScript does not support generic types and methods.

Type Parameters

  • TParameters
    The parameters in this alter stored procedure operation. You do not need to specify this type, it will be inferred from the parametersAction parameter you supply.

Parameters

  • name
    Type: System.String
    The name of the stored procedure. Schema name is optional, if no schema is specified then dbo is assumed.
  • anonymousArguments
    Type: System.Object
    The additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments. For example, 'new { SampleArgument = "MyValue" }'.

See Also

Reference

DbMigration Class

AlterStoredProcedure Overload

System.Data.Entity.Migrations Namespace