public ActionResult Index()
        {
            var db = new BikeStoreCustomContext();
            var brandListViewModels = AutoMapper.Mapper.Map<List<ViewModels.BrandViewModel>>(db.Brands);

            //return RedirectToAction("Index", "Bike");
            return View(brandListViewModels);
        }
Example #2
0
 private static void SetupDatabaseIfNotExists()
 {
     var context = new BikeStoreCustomContext();
     if (context.Database.CreateIfNotExists())
     {
         new BikeStore.Migrations.Configuration().SeedFromExternal(context);
     }
 }