I'm wondering what's the general approach of passing a list of lookup values to a view in MVC. Currently I have 2 db tables and I'm using db first EF6 to interface. My main table has a lookup table and I want to populate a dropdownlist of my view with all the values of the lookup so that the user can pick when creating and editing.
Employee Table
id primary key
name varchar
department id - this is the id of the department in the lookup
Department table
id primary key
name varchar
Is it best to create a partial class for the employee model and add a new property called allDepartments and then in my controller call a method that gets all the departments before passing the model to the view, or is it better to dump the departments in the viewbag/viewdata dictionary?
What is the general approach here?