Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 3 collections: dealerships, brands, and models. I'm trying to pass a dealershipID to a controller, then for each brand having the dealershipID , loop through the models. My context is carcontext.

I can see how to pass the dealershipID using actionresult( int id) and then use the .include find. I'm getting lost after that. I'm concerned that my find will only return a single brand not a collection.

So in psudeo code:
Select brands from carecontext where lot contains dealershipID
@foreach (var bitem = vmodel.brand) 
  if modelID is notnull  -----check for at least one model
   (
      @foreach (var mitem = vmodel.model)
          { create a bitmap image }  -I can create the image
       assign bitmap to array
    }    
 pass array in returnview()

where the same context will build a table to display the brand information and include the image as part of the table.

I need help in the mvc4 syntax of the pseudo code, creating and assigning the array and the syntax to pass it in the returnview().

I'm using Contoso and music store as guides. Any other tutorial suggestions??

A newbie getting lost in syntax and muddling through (too many) new concepts lazy loading, lambda, methods.
Many thanks for the help.
Posted
Updated 18-Nov-13 14:15pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900