nerdexam
Microsoft

70-516 · Question #1

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You manually create your own Context class named AdventureWorksDB that inherits from ObjectContext…

The correct answer is B. ExecuteFunction. ExecuteFunction(String, ObjectParameter[]) Executes a stored procedure or function that is defined in the data source and expressed in the conceptual model; discards any results returned from the function; and returns the number of rows affected by the execution…

advanced WCF features

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You manually create your own Context class named AdventureWorksDB that inherits from ObjectContext. You need to use AdventureWorksDB to invoke a stored procedure that is defined in the data source. Which method should you call?

Options

  • ATranslate
  • BExecuteFunction
  • CExecuteStoreQuery
  • DExecuteStoreCommand

How the community answered

(40 responses)
  • A
    13% (5)
  • B
    78% (31)
  • C
    8% (3)
  • D
    3% (1)

Explanation

ExecuteFunction(String, ObjectParameter[]) Executes a stored procedure or function that is defined in the data source and expressed in the conceptual model; discards any results returned from the function; and returns the number of rows affected by the execution. ExecuteStoreCommand() Executes an arbitrary command directly against the data source using the existing connection. ExecuteStoreQuery<TElement>(String, Object[]) Executes a query directly against the data source that returns a sequence of typed results. Translate<TElement>(DbDataReader) Translates a DbDataReader that contains rows of entity data to objects of the requested entity type. ObjectContext.ExecuteFunction Method

Topics

#ObjectContext#ExecuteFunction#stored procedure#Entity Framework

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice