I'd like to populate a dropdown list based on the selection chosen in the previous field.
Currently I have 2 Lists from my ViewModel like so:
Manufacturers = context.ManufacturersTable.OrderBy(x => x.ManufacturerName).ToList(),
Models = context.ModelsTable.OrderBy(x => x.ModelName).ToList(),
Both lists are populated using a SQL Table with their own data model.
In the Models table, I have a column for ManufacturerID which matches that of the ManufacturerID in the Manufacturers table.
I'd like to populate the Models list based on the selection of the Manufacturers list so that only models associated with the selected manufacturer are displayed.
How would I do this using Lambda?
I've been playing with Where and Select but haven't quite been able to get there.
EDIT:
Here's the tables
MANUFACTURER | MANUFACTURER_ID
Manufacturer 1 GUID1
Manufacturer 2 GUID2
MODEL | MODEL_ID | MANUFACTURER_ID
Model 1 | GUID1 | GUID1
Model 2 | GUID2 | GUID2
Model 3 | GUID3 | GUID1
Model 4 | GUID4 | GUID1