Populate DropDownList in ASP.NET MVC from database table using Entity Framework 6 and ViewModel
I have been scratching my head for a whole night on an issue I can do quickly using ajax/jquery and stored procedures. I want to 1) Populate a drop down list from values obtained from a database table using Entity Framework and view model. I DO NOT WANT TO USE VIEWBAG OR VIEWDATA. Any help appreciated. 2) How can I generate a Create View using the View Model with the all the default fields ? The scaffholding works on a model but not on a view model ? MY MODELS public class Employee { public int EmployeeID { get; set; } public string Name { get; set; } public string Gender { get; set; } public