GetAllManufacturersAsList() public method

public GetAllManufacturersAsList ( ) : IEnumerable
return IEnumerable
Example #1
0
        // ############################################################

        //
        // GET: /Vehicles/Create
        public ActionResult Create()
        {
            // Prepare the data for the view
            var addForm = new VehicleAddForm();

            // If necessary, provide initial values for the form
            addForm.ModelYear = DateTime.Now.Year;

            // Add the 'select' UI control items
            addForm.Manufacturers = new SelectList(m.GetAllManufacturersAsList(), "Id", "Name");

            return(View(addForm));
        }