internal static void Initialize(this BoardGameHubDbContext db) { if (db.Products.Count() == 0) { db.Products.AddRange ( new Product { Description = "Farm game", Name = "Agricola", Price = 49.99m, Image = "/images/agricola.jpg" }, new Product { Description = "Party game", Name = "Mysterium", Price = 39.99m, Image = "/images/mysterium.jpg" }, new Product { Description = "Co-op game", Name = "Betrayal At House On The Hill", Price = 49.99m, Image = "/images/betrayal.jpg" } ); db.SaveChanges(); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, BoardGameHubDbContext db) { if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } //I need this to instruct my app to use Cookies for tracking Signin/SignOut status app.UseAuthentication(); app.UseStaticFiles(); db.Initialize(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
public ProposalController(BoardGameHubDbContext context) { _context = context; }
public ProductsAdminController(BoardGameHubDbContext context, UserManager <BoardGameHubUser> userManager) { _context = context; _userManager = userManager; }
public CartController(BoardGameHubDbContext context) { _context = context; }
public ReceiptController(BoardGameHubDbContext context) { _context = context; }
public CheckoutController(BoardGameHubDbContext context, SendGridClient sendGridClient, IBraintreeGateway brainTreeGateway) { _sendGridClient = sendGridClient; _context = context; _brainTreeGateway = brainTreeGateway; }
public ProductController(BoardGameHubDbContext context) { _context = context; }
public AccountController(SignInManager <BoardGameHubUser> signInManager, UserManager <BoardGameHubUser> userManager, BoardGameHubDbContext context) { this._signInManager = signInManager; this._userManager = userManager; this._context = context; }
public TradeController(BoardGameHubDbContext context, UserManager <BoardGameHubUser> boardGameHubUser) { _context = context; _boardGameHubUser = boardGameHubUser; }