ObjectContext.ExecuteFunction(Of TElement) Method (String, ObjectParameter())
Executes a stored procedure or function that is defined in the data source and mapped in the conceptual model, with the specified parameters. Returns a typed ObjectResult(Of T).
Assembly: System.Data.Entity (in System.Data.Entity.dll)
'Declaration Public Function ExecuteFunction(Of TElement) ( _ functionName As String, _ ParamArray parameters As ObjectParameter() _ ) As ObjectResult(Of TElement)
- Type: System.String
The name of the stored procedure or function. The name can include the container name, such as <Container Name>.<Function Name>. When the default container name is known, only the function name is required.
The ExecuteFunction method is a helper method that is used to execute stored procedures or functions that are defined in the data source and expressed in the conceptual model. The Entity Data Model tools generate a method for each FunctionImport Element in the conceptual model. These methods call a strongly-typed ExecuteFunction to return a typed ObjectResult(Of T). For more information, see Application Code using Stored Procedures (Enity Framework).
All parameters for the function are required in the parameters array and all types are checked against the metadata for the import function, including the type of the function itself. Nothing values are permitted for CLR value types. Parameter validation is performed by the provider.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.