I am NEW in MVC3 so bear with me here. I went through this link to start learning MVC3: ASP.NET MVC3 Tutorial
I created everything alright. Now I want to go one step ahead with LINQ. In my UserModel class (as in this example) I created this code in another class inside this called User where there is implementation of Adding, Deleting, Editing.
DataDataContext dt = new DataDataContext();
var q = from a in dt.GetTable<Entity>()
select a;
开发者_运维百科'Data' is the DBMLconnection for LINQ. And Entity is the table.
Now how should I select selective columns in the table (Entity) to my view? Any answers or links will be appreciated! Thank you :)
I think you should start with:
http://www.asp.net/mvc/tutorials/mvc-music-store-part-1
In your code. Pass first the entity to your linq.
Then after that in your Controller right click return view(q) and then click add view and select details.
Regards
精彩评论