// GET: SuppliersController1
        public ActionResult Index()
        {
            var typesofsuppliers = _repos.FindAll().ToList();

            var mappingtolist = _mapper.Map <List <Supplier>, List <SupplierViewModel> > (typesofsuppliers);

            return(View(mappingtolist));
        }
Beispiel #2
0
        // GET: productdetails/Create
        public ActionResult Create()
        {//var Customers = _Suppliersrepos.FindAll();
            var suppliers     = _Suppliersrepos.FindAll();
            var supplierItems = suppliers.Select(q => new SelectListItem
            {
                Text  = q.SupplierName,
                Value = q.Id.ToString()
            });
            var model = new ProductDetailsViewModel
            {
                Suppliers = supplierItems
            };

            return(View(model));
        }