问题描述
尝试使用asp.net首次。需要创建一个asp.net mvc的API,它提供了获取关于如5表返回1列API。 pretty简单的东西。但我有困难的时候,把一切融合在一起。我能够创建一个简单的MVC的教程,并调用服务,从模型返回静态数据。我也能使用EF5产生的车型,但在这里,我不确定如何将它们连接到我的控制器获取数据。
Attempting to use asp.net for the first time. Need to create a asp.net mvc api which provides GET API for like 5 tables returning 1 column. Pretty simple stuff. I am however having a difficult time bringing everything together. I was able to create a tutorial on a simple mvc and call a service to return static data from a model. I was also able to use EF5 to generate the models, but from here I was unsure how to connect them to my Controller to get the data.
所以我的问题。有谁知道一个示例是数据库第一则展示了如何使用进口的数据库中某种MVC API的?
So my question. Does anyone know of a sample which is database first then shows how to use that "imported" database in some sort of MVC api?
推荐答案
在这里,你可以试试这个例子:
Here you could try this examples:
构建一个MVC 3应用程序,视频
Building an MVC 3 App with Database First and Entity Framework 4.1, video is here
数据库第一的方针,这是MVC4一个例子
Database First Approach in Entity Framework, this is an example on MVC4
希望这有助于。
这篇关于教程ASP.NET MVC数据库第一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!