开发者

Creating the controller using MVC3

I'm trying to get a UI using MVC. I'm currently battling with MVC3. There does’nt seem to be much documentation.

Here’s what I’m thinking. I believe I need to create stored procs for each query. I’m creating the the LINQ to SQL for the model. I’m trying to figure out how to create the cotroller. Any suggesti开发者_如何学JAVAon on how to input data to the stored proc and return results to the view? The default controller classes dont seem to do anything

Am I doing this right? Or MVC2/MVC1 the easier way to go?

I'm new to MVC on .NET. Thanks in advance.


There is plenty of documentation, if you look for it... Also, http://www.asp.net/mvc is a good place to start.

What it seems like you really need documentation for is LINQ-to-SQL, not MVC, which is here: http://msdn.microsoft.com/en-us/library/bb425822.aspx

There's also a great ScottGu tutorial here: http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

The whole series is available here, including a PDF download: http://scottonwriting.net/sowblog/archive/2010/07/27/links-to-scott-guthrie-s-using-linq-to-sql-tutorials.aspx


I believe I need to create stored procs for each query.

You could do this but it might be an overkill. I would recommend you watching the tutorials here. Paragraph 5. covers tutorials about using Entity Framework for data access. Try them out and if you encounter some specific issues don't hesitate to ask a question by showing what you have tried and what didn't work for you.


If you're using Linq to SQL, you don't need to use Stored Procs at all.

If you want more information on MVC generally, try doing the NerdDinner example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜