Translate a query to MVC

I am new to MVC4 and uncertain how to implement this query into my MVC "world" any tips?  Basically trying to do multi table lookups and display data... simple stuff

SELECT     lcEntries.entry_id, lcEvents.entered_at AS EventEnteredAt, lcEventLookUps.eventType AS Description, lcEvents.scanner_at AS Location,
                      lcEvents.punit AS [PERSON-UNIT], lcEvents.tote_id AS eventstote_id, lcEntries.container_id, lcEvents.orl AS [Rack Location],
                      lcEvents.notes AS Notes
FROM         lcEventLookUps RIGHT OUTER JOIN
                      lcEvents ON lcEventLookUps.eventID = lcEvents.event_type LEFT OUTER JOIN
                      lcEntries ON lcEvents.entry_id = lcEntries.UUID
WHERE     (lcEntries.entry_type = N'specimen') AND (lcEntries.entry_id = N'3')
ORDER BY EventEnteredAt
Dan FloodDeveloperAsked:
Who is Participating?
If I understood your simple stuff correctly then -
1. Add a controller to your MVC project, lets say MyController.
2. Create a POCO (ie a class) Entity to hold the result of above query. Add properties to this class.
3. In the Index() method of MyController initialize the List<POCOEntity> and populate the result there.
4. Pass this list to View.
5. Right click on Index() method and add a strongly typed (of PCOCO) view to the solution and select scaffolding template as List.
6. Run the project and see the output.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.