public ActionResult Index() { var db = new BikeStoreCustomContext(); var brandListViewModels = AutoMapper.Mapper.Map<List<ViewModels.BrandViewModel>>(db.Brands); //return RedirectToAction("Index", "Bike"); return View(brandListViewModels); }
private static void SetupDatabaseIfNotExists() { var context = new BikeStoreCustomContext(); if (context.Database.CreateIfNotExists()) { new BikeStore.Migrations.Configuration().SeedFromExternal(context); } }