Calling a stored procedure
Calling a stored procedure is different from calling a table or a view because a stored procedure can't be called directly. A function import has to be added for the stored procedure and its result set has to be mapped. The modeling of a stored procedure is also different from modeling a table or view. In the following sections we will explain how to call a simple stored procedure, how to map the returned result of a stored procedure to an entity class, and how to create a new entity for the result set.
We will reuse the same application that we used in the previous chapter and add more testing methods to the program.
Mapping a stored procedure to a new entity class
First we will try to call a simple stored procedure. In the sample database there is a stored procedure called "Ten Most Expensive Products". We will call this stored procedure to get the top ten most expensive products.
Modeling a stored procedure
Before we can call this stored procedure we need to model...