Example #1
0
 public EditModel(ConikeShopContext context,
                  IAuthorizationService authorizationService,
                  UserManager <IdentityUser> userManager)
     : base(context, authorizationService, userManager)
 {
     _context = context;
 }
 public Product_BasePageModel(
     ConikeShopContext _context,
     IAuthorizationService authorizationService,
     UserManager <IdentityUser> userManager) : base()
 {
     _Context             = _context;
     UserManager          = userManager;
     AuthorizationService = authorizationService;
 }
Example #3
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ConikeShopContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ConikeShopContext> >()))
            {
                // Look for any movies.
                if (context.Products.Any())
                {
                    return;   // DB has been seeded
                }

                context.Products.AddRange(
                    new Product
                {
                    Title = "Baseball Bat",
                    Genre = "Baseball",
                    Price = 21.99M
                },
                    new Product
                {
                    Title = "Basketball ball",
                    Genre = "Basketball",
                    Price = 3.49M
                }, new Product
                {
                    Title = "Football ball",
                    Genre = "Football",
                    Price = 7.99M
                }, new Product
                {
                    Title = "Volleyball Ball",
                    Genre = "Volleyball",
                    Price = 4.99M
                }, new Product
                {
                    Title = "Golf Club",
                    Genre = "Golf",
                    Price = 30.99M
                }

                    );
                context.SaveChanges();
            }
        }
 public ProductRepository(ConikeShopContext context) : base(context)
 {
 }
Example #5
0
 public OrderModel(ConikeShopContext context)
 {
     _context = context;
 }
Example #6
0
 public DetailsModel(ConikeShopContext context)
 {
     _context = context;
 }