MVC - Select from a stored procedure in the Entity Framework

I am new to ASP.NET MVC. I have to create a page where users order their stores in a central warehouse. Products and amounts are transferred by the stored procedure from the database. I need to show the rows in a gridview that are computed by a stored procedure. I want to insert the changed data into a table in SQL after the user makes changes to the gridview. Users can call up a saved document and make changes to it and save it again.

I can’t build a strategy on how to do this. If I use the Entity Framework, I can show the rows of the SQL table in the grid, but that is not my goal. I have to let SQL compute the data first. Could you give me a starting point and steps to go forward. I hope I can explain what I need.

+1
source share
1 answer

There are some easy steps to do this.

1- Go and update the model from the database and add the required stored procedure enter image description here

2- create a complex type from the model browser

enter image description here

in a complex type, display the fields of the stored procedure when they return the data.

3- and map the complex type to the stored procedure. and use it when using a table.

0
source

All Articles