I have 2 tables:
- Categories (int Id, string Title)
- Works (int categoryId, string WorkTitle, int id)
Table Works has a foreign key (many to single) to Categories table.
I want to have such result:
Title (id 1)
WorkTitle (Works.id) | WorkTitle (Works.id) | WorkTitle (Works.id) (this is works in thsi category)
Title (id 2)
WorkTitle (Works.id) | WorkTitle (Works.id) | WorkTitle (Works.id) (this is works in thsi category)
......
Title (id n)
WorkTitle (Works.id) | WorkTitle (Works.id) | WorkTitle (Works.id)(this is works in thsi category)
What should be Model, View And Controller for do this?
Thanks a lot!
This should get you started. I’m assuming Entity Framework 4.1 code first. Use the ADO.NET Poco Entity template from NuGet to fill in the database initialization stuff.
Model
Controller
View