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

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