Exemple #1
0
 public ReceiptController(ThisSiteDbContext thisSiteDbContext,
                          EmailService emailService,
                          SignInManager <ThisSiteUser> signInManager,
                          BraintreeGateway braintreeGateway)
 {
     this._thisSiteDbContext = thisSiteDbContext;
     this._emailService      = emailService;
     this._signInManager     = signInManager;
     this._brainTreeGateway  = braintreeGateway;
 }
Exemple #2
0
 public CheckoutController(ThisSiteDbContext thisSiteDbContext,
                           EmailService emailService,
                           SignInManager <ThisSiteUser> signInManager,
                           BraintreeGateway braintreeGateway, SmartyStreets.USStreetApi.Client usStreetApiClient)
 {
     this._thisSiteDbContext = thisSiteDbContext;
     this._emailService      = emailService;
     this._signInManager     = signInManager;
     this._brainTreeGateway  = braintreeGateway;
     this._usStreetApiClient = usStreetApiClient;
 }
Exemple #3
0
 //using Microsoft.AspNetCore.Identity
 public AccountController(
     SignInManager <ThisSiteUser> signInManager,
     EmailService emailService,
     BraintreeGateway braintreeGateway,
     ThisSiteDbContext thisSiteDbContext,
     RoleManager <IdentityRole> roleManager
     )
 {
     this._signInManager     = signInManager;
     this._emailService      = emailService;
     _braintreeGateway       = braintreeGateway;
     this._thisSiteDbContext = thisSiteDbContext;
 }
Exemple #4
0
        internal static void Initialize(this ThisSiteDbContext db)
        {
            db.Database.Migrate();

            if (db.Products.Count() == 0)
            {
                db.Products.Add(new Product
                {
                    Description = "This hat sucks.",
                    Image       = "/images/hat1.jpg",
                    Name        = "This Site Sucks, the Hat",
                    Price       = 25m
                });
                db.Products.Add(new Product
                {
                    Description = "This shirt sucks.",
                    Image       = "/images/shirt1.jpg",
                    Name        = "This Site Sucks, the Shirt",
                    Price       = 20m
                });
                db.Products.Add(new Product
                {
                    Description = "<div style=\"align:center\">",
                    Image       = "/images/shirtcss1.jpg",
                    Name        = "CSS Sucks, The Shirt",
                    Price       = 20m
                });
                db.Products.Add(new Product
                {
                    Description = "Like your dreams, this shirt is broken.",
                    Image       = "/images/brokenshirt.jpg",
                    Name        = "Broken Shirt, The Shirt",
                    Price       = 20m
                });


                db.SaveChanges();
            }
        }
Exemple #5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ThisSiteDbContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseAuthentication();

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            db.Initialize();
        }
Exemple #6
0
 public HomeController(ThisSiteDbContext thisSiteDbContext)
 {
     _db = thisSiteDbContext;
 }
Exemple #7
0
 public CartController(ThisSiteDbContext context)
 {
     _context = context;
 }
Exemple #8
0
 public ProductsAdminController(ThisSiteDbContext context, IHostingEnvironment env)
 {
     _context = context;
     _env     = env;
 }
 public ProductController(ThisSiteDbContext context)
 {
     _context = context;
 }