There are a number of ways to query the EDM, which then retrieves data from the database.
This section will demonstrate three common EDM querying methods: LINQ, LINQ with lambda expressions, and Entity SQL.
Lastly, you will show how to use Model-First with Oracle database.
In a Model-First scenario, a developer first creates an Entity Framework object-relational data model.
Approximately 30 mins Microsoft Entity Framework abstracts the relational, logical database schema and presents a conceptual schema to the . In this tutorial, you will learn how to use Oracle Database and these three technologies with Microsoft Visual Studio and Oracle Data Provider for . Then, you will query the EDM using three different methods: 1. LINQ query with a lambda expression and calling a stored procedure to perform an update against the results 3.
Model-First allows the conceptual model to be created first by the developer.
We need to create DB Context object to understand the fact and advantages, so let's create a and dig into more details.
Kindly follow the following procedure to create a DBContext.
Choose Add Connection and select a Data source name with the HR schema, such as ORCL. You will now create the stored procedures that will be used later in this lab to perform updates and data retrieval. Copy the code for INCREASE_SALARY_BY_10, UPDATE_AND_RETURN_SALARY and OUTPARAM into the SQL Query Window and click Execute Query ()for each of the stored procedures.
The stored procedure will modify the database data and return the results with an implicit resultset.
To return the resultset, you will provide the resultset parameter information in a . You will then insert and delete data to the database without using a stored procedure.
), which you can download here, if interested: Happy Programming!
The Io T world may be exciting, but there are serious technical challenges that need to be addressed, especially by developers.