MVC - 从实体框架中的存储过程中选择 [英] MVC - Select from Stored Procedure in Entity Framework
问题描述
我无法构建如何制作策略。如果我使用实体框架,我可以在网格中显示SQL表格行,但这不是我的目标。我必须让SQL首先计算数据。请你给我一些起点和步骤,继续吧。我希望我可以解释一下我需要的。
有一些简单的步骤来实现
1-从数据库转到并更新模型,并添加所需的存储过程
复杂类型在返回数据时映射您存储的过程字段。
3-并将该复杂类型映射到存储过程。并使用它作为您使用表。
I am new to ASP.NET MVC. I should create a page where users enters an order for their shops by central warehouse. The products and amounts are listed by a stored procedure from database. I have to show rows in a gridview which are calculated by the stored procedure. I want to insert the changed data in a table in SQL after the user make changes on the gridview. Users can call the saved doc back and make changes on it and save it again.
I can't build a strategy how that can be made. If I use Entity Framework I can show the SQL table rows in grid but it is not my goal. I have to let the SQL calculate first the data. Could you please give me some start point and steps to go ahead. I hope I could explain what I need.
There Are some simple steps to do that
1- Go and update model from database and add the required Stored procedure
2- create a complex type from model browser
in complex type map your Stored procedure fields as it returns the data.
3- and map that complex type to the stored procedure. and use it as you use table.
这篇关于MVC - 从实体框架中的存储过程中选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!