public void PopulateLocationsDropDownList(Models.CityAssetsDBContext _context, object selectedLocation = null) { var locationsQuery = from d in _context.Locations orderby d.Description select d; LocationNameSL = new SelectList(locationsQuery.AsNoTracking(), "ID", "Description", selectedLocation); }
public void PopulateTypesDropDownList(Models.CityAssetsDBContext _context, object selectedType = null) { var typesQuery = from d in _context.Types orderby d.Description select d; TypeNameSL = new SelectList(typesQuery.AsNoTracking(), "ID", "Description", selectedType); }
public void PopulateDepartmentsDropDownList(Models.CityAssetsDBContext _context, object selectedDepartment = null) { var departmentsQuery = from d in _context.Departments orderby d.Description // Sort by name. select d; DepartmentNameSL = new SelectList(departmentsQuery.AsNoTracking(), "ID", "Description", selectedDepartment); }