Exemplo n.º 1
0
 public static void Seed(this CarvedRockDbContext dbContext)
 {
     if (!dbContext.Products.Any())
     {
         dbContext.Products.Add(new Product {
             Name          = "Mountain Walkers",
             Description   = "Use these shoes to walk up mountains",
             Price         = 219.5m,
             Rating        = 4,
             Type          = ProductType.Boots,
             Stock         = 12,
             PhotoFileName = "NotFound.jpg"
         });
     }
 }
        public static void Seed(this CarvedRockDbContext dbContext)
        {
            if (!dbContext.Products.Any())
            {
                dbContext.Products.Add(new Product
                {
                    Name           = "Mountain Walkers",
                    Description    = "Use these sturdy shoes to pass any mountain range with ease.",
                    Price          = 219.5m,
                    Rating         = 4,
                    Type           = ProductType.Boots,
                    Stock          = 12,
                    PhotoFileName  = "shutterstock_66842440.jpg",
                    IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                    ProductReviews = new List <ProductReview>
                    {
                        new ProductReview
                        {
                            Title  = "Crossed the Himalayas",
                            Review = "First released almost 30 years ago, the Titan 26078 is a classic work boot. It’s also one of Timberland’s all time best sellers."
                        },
                        new ProductReview
                        {
                            Title  = "Comfortable",
                            Review = "One of the most comfortable hiking boots available, each pair comes complete with the Power Fit Comfort System, designed to offer maximum support at key areas of your feet."
                        }
                    }
                });

                dbContext.Products.Add(new Product
                {
                    Name           = "Army Slippers",
                    Description    = "For your everyday marches in the army.",
                    Price          = 125.9m,
                    Rating         = 3,
                    Type           = ProductType.Boots,
                    Stock          = 56,
                    PhotoFileName  = "shutterstock_222721876.jpg",
                    IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                    ProductReviews = new List <ProductReview>
                    {
                        new ProductReview
                        {
                            Title  = "Indestructible",
                            Review = "They have absolutely no break in period and can literally be worn to work the day that you get them."
                        },
                        new ProductReview
                        {
                            Title  = "Safety toe",
                            Review = "The safety toe is made from an aluminium alloy which offers all the protection of steel but half the weight. The soles are also oil, abrasion and slip resistant."
                        }
                    }
                });

                dbContext.Products.Add(new Product
                {
                    Name           = "Backpack Deluxe",
                    Description    = "This backpack can survive any tornado.",
                    Price          = 199.99m,
                    Rating         = 5,
                    Type           = ProductType.ClimbingGear,
                    Stock          = 66,
                    PhotoFileName  = "shutterstock_6170527.jpg",
                    IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                    ProductReviews = new List <ProductReview>
                    {
                        new ProductReview
                        {
                            Title  = "Feels like canvas",
                            Review = "The Better Backpack is made from 100% recycled plastic but looks and feels like canvas. We were sent the grey bag with the tan leather accents and silver zippers. I’ve personally always liked tan leather paired with the color grey and appreciate the feel of the leather pull tabs and handles at the top of the bag. Additionally the inside is navy blue with a diagonal stitch pattern which gives it an air of sophistication."
                        }
                    }
                });

                dbContext.Products.Add(new Product
                {
                    Name          = "Climbing Kit",
                    Description   = "Anything you need to climb the mount Everest.",
                    Price         = 299.5m,
                    Rating        = 5,
                    Type          = ProductType.ClimbingGear,
                    Stock         = 3,
                    PhotoFileName = "shutterstock_48040747.jpg",
                    IntroducedAt  = DateTimeOffset.Now.AddMonths(-1)
                });

                dbContext.Products.Add(new Product
                {
                    Name           = "Blue Racer",
                    Description    = "Simply the fastest kayak on earth and beyond for 2 persons.",
                    Price          = 350m,
                    Rating         = 5,
                    Type           = ProductType.Kayaks,
                    Stock          = 8,
                    PhotoFileName  = "shutterstock_441989509.jpg",
                    IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                    ProductReviews = new List <ProductReview>
                    {
                        new ProductReview
                        {
                            Title  = "So this is my 1st ever...",
                            Review = "So this is my 1st ever kayak and my 1st experience paddling a kayak. I struggled with whether I should spend more money to buy a \"Fishing\" kayak, or even a \"higher end\" kayak because my fear was paddling around a bathtub on the lake. I have to say, I love this kayak for me. It doesn\'t have a lot of the bells and whistles that some of the pricier kayaks have but, I\'m not disappointed.\r\n\r\nIt\'s pretty bare bones aside from some dry storage areas and some bungees. It does have a bungee to hold your paddle on the side. I feel it paddles very easy. It goes exactly where I want it to, I didn\'t struggle to keep it on course. A stiff wind can knock you off track but it was very sturdy and I feel like it would take a lot to tip it over. I stayed fairly dry aside from the dripping off the paddle but its a sit on top so thats to be expected."
                        },
                        new ProductReview
                        {
                            Title  = "Great for all genders",
                            Review = "I am a fit 5'7 woman 140lbs and I take my 30# dog along with no troubles. I have fished with it by using a bucket strapped in the back with my bungee cords. It holds my rods and small tackle tray, bug spray etc so I can get to it all easily. I can even get it up on the roof of my jeep alone. "
                        },
                        new ProductReview
                        {
                            Title  = "Happy",
                            Review = "Very happy with my purchase and I recommend this to anyone who doesn't want to spend over 600$ on a kayak but also doesn't want a cheap ole hunk of plastic. "
                        }
                    }
                });

                dbContext.Products.Add(new Product
                {
                    Name           = "Orange Demon",
                    Description    = "One person kayak with hyper boost button.",
                    Price          = 450m,
                    Rating         = 2,
                    Type           = ProductType.Kayaks,
                    Stock          = 1,
                    PhotoFileName  = "shutterstock_495259978.jpg",
                    IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                    ProductReviews = new List <ProductReview>
                    {
                        new ProductReview {
                            Title  = "Hobie took the paddle out",
                            Review = "Hobie took the paddle out of the hands of the masses, and changed kayak fishing forever. Ive heavily fished the \'Revo\' since 2011 and feel its about perfect for my use. As a serious cyclist its a natural fit, and it can cover huge distances. The torque the Mirage drive generates in rough conditions is often overlooked. I feel it could easily pull any propeller driven kayak backwards in a tug-o-war. I recently weighed my bare hull at 69#s, and that\'s not too shabby for ANY pedal yak. I still fish from paddle yaks, but I spend more time with the rods in my hands when on the Revo."
                        }
                    }
                });

                dbContext.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public static void Seed(this CarvedRockDbContext dbContext)
        {
            if (dbContext.Products.Any())
            {
                return;
            }

            dbContext.Products.Add(new Product
            {
                Name           = "Mountain Walkers",
                Description    = "Use these sturdy shoes to pass any mountain range with ease.",
                Price          = 219.5m,
                Rating         = 4,
                Type           = ProductType.Boots,
                Stock          = 12,
                PhotoFileName  = "shutterstock_66842440.jpg",
                IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                ProductReviews = new List <ProductReview>()
                {
                    new ProductReview()
                    {
                        Title  = "Comfortable for all day trekking",
                        Review = "Very comfortable for a full day outing"
                    },
                    new ProductReview()
                    {
                        Title  = "What a piece a' junk",
                        Review = "The laces come off like 25 times a day. Am i supposed to spend my time tying them or trekking on them?"
                    },
                    new ProductReview()
                    {
                        Title  = "A decent pair",
                        Review = "They are good and do their job well. Could have been little less costlier to make it more competetive."
                    },
                }
            });

            dbContext.Products.Add(new Product
            {
                Name           = "Army Slippers",
                Description    = "For your everyday marches in the army.",
                Price          = 125.9m,
                Rating         = 3,
                Type           = ProductType.Boots,
                Stock          = 56,
                PhotoFileName  = "shutterstock_222721876.jpg",
                IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                ProductReviews = new List <ProductReview>()
                {
                    new ProductReview()
                    {
                        Title  = "A veteran's delight",
                        Review = "Very comfortable for a relaxing evening."
                    },
                    new ProductReview()
                    {
                        Title  = "Good value for money.",
                        Review = "They are nice for the price they have to offer."
                    },
                    new ProductReview()
                    {
                        Title  = "A decent pair",
                        Review = "They are good and do their job well."
                    },
                }
            });

            dbContext.Products.Add(new Product
            {
                Name           = "Backpack Deluxe",
                Description    = "This backpack can survive any tornado.",
                Price          = 199.99m,
                Rating         = 5,
                Type           = ProductType.ClimbingGear,
                Stock          = 66,
                PhotoFileName  = "shutterstock_6170527.jpg",
                IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                ProductReviews = new List <ProductReview>()
                {
                    new ProductReview()
                    {
                        Title  = "A hogger's heaven",
                        Review = "I hog a lot of luggage and it provides ample space for it."
                    },
                    new ProductReview()
                    {
                        Title  = "Very costly.",
                        Review = "After buying it after saving for it for a year, I don't really feel it is worth it."
                    },
                    new ProductReview()
                    {
                        Title  = "A tough nut.",
                        Review = "Guess what? I was in a tornado and it survived well enough for me to write about it."
                    },
                }
            });

            dbContext.Products.Add(new Product
            {
                Name           = "Climbing Kit",
                Description    = "Anything you need to climb the mount Everest.",
                Price          = 299.5m,
                Rating         = 5,
                Type           = ProductType.ClimbingGear,
                Stock          = 3,
                PhotoFileName  = "shutterstock_48040747.jpg",
                IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                ProductReviews = new List <ProductReview>()
                {
                    new ProductReview()
                    {
                        Title  = "Broke my crown.",
                        Review = "I broke my crown when it snapped, Jill came tumbling after."
                    },
                    new ProductReview()
                    {
                        Title  = "What a piece a' junk",
                        Review = "Don't waste your money on this one."
                    },
                    new ProductReview()
                    {
                        Title  = "Will only get you through smooth whether.",
                        Review = "No strings to latch onto in case it gets wet. Would'nt bet my life on it in rough weather."
                    },
                }
            });

            dbContext.Products.Add(new Product
            {
                Name           = "Blue Racer",
                Description    = "Simply the fastest kayak on earth and beyond for 2 persons.",
                Price          = 350m,
                Rating         = 5,
                Type           = ProductType.Kayaks,
                Stock          = 8,
                PhotoFileName  = "shutterstock_441989509.jpg",
                IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                ProductReviews = new List <ProductReview>()
                {
                    new ProductReview()
                    {
                        Title  = "Good for beginners",
                        Review = "Nice confidence builder for ameteurs."
                    },
                    new ProductReview()
                    {
                        Title  = "Nothing to challenge for an experienced kayaker.",
                        Review = "Already pretty fast. Does'nt pose any challenge for your body to overcome it."
                    },
                    new ProductReview()
                    {
                        Title  = "Very costly.",
                        Review = "Very costly for the function it serves."
                    },
                }
            });

            dbContext.Products.Add(new Product
            {
                Name           = "Orange Demon",
                Description    = "One person kayak with hyper boost button.",
                Price          = 450m,
                Rating         = 2,
                Type           = ProductType.Kayaks,
                Stock          = 1,
                PhotoFileName  = "shutterstock_495259978.jpg",
                IntroducedAt   = DateTimeOffset.Now.AddMonths(-1),
                ProductReviews = new List <ProductReview>()
                {
                    new ProductReview()
                    {
                        Title  = "Nice but not for everyone.",
                        Review = "This is for experienced campaigners and not for average joe kaykakers."
                    },
                    new ProductReview()
                    {
                        Title  = "Beware Amateurs.",
                        Review = "Newbies make the mistake of overestimating themselves and buying it ahead of time."
                    },
                    new ProductReview()
                    {
                        Title  = "Tendency to overuse the hyper-booster",
                        Review = "As a newcomer, it helped me to move to next level. Although at the beginning I did have the tendency to overuse the booster."
                    },
                }
            });

            dbContext.SaveChanges();
        }
Exemplo n.º 4
0
        public static void Seed(this CarvedRockDbContext dbContext)
        {
            if (!dbContext.Policies.Any())
            {
                dbContext.Owners.AddRange(new List <Owner>
                {
                    new Owner
                    {
                        Name = "Owner 1"
                    },
                    new Owner
                    {
                        Name = "Owner 2"
                    },
                    new Owner
                    {
                        Name = "Owner 3"
                    },
                    new Owner
                    {
                        Name = "Owner 4"
                    }
                });

                dbContext.Policies.Add(new Policy
                {
                    Name    = "My Policy 1",
                    Type    = PolicyTypeEnum.WholeLife,
                    OwnerId = 1
                });

                dbContext.Policies.Add(new Policy
                {
                    Name    = "My Policy 2",
                    Type    = PolicyTypeEnum.Annuity,
                    OwnerId = 1
                });

                dbContext.Policies.Add(new Policy
                {
                    Name    = "My Policy 3",
                    Type    = PolicyTypeEnum.WholeLife,
                    OwnerId = 2
                });

                dbContext.Policies.Add(new Policy
                {
                    Name    = "My Policy 4",
                    Type    = PolicyTypeEnum.Annuity,
                    OwnerId = 2
                });

                dbContext.Policies.Add(new Policy
                {
                    Name    = "My Policy 5",
                    Type    = PolicyTypeEnum.WholeLife,
                    OwnerId = 3
                });

                dbContext.Policies.Add(new Policy
                {
                    Name    = "My Policy 6",
                    Type    = PolicyTypeEnum.Annuity,
                    OwnerId = 4
                });

                dbContext.SaveChanges();
            }
        }
Exemplo n.º 5
0
        public static void Seed(this CarvedRockDbContext dbContext)
        {
            if (!dbContext.Products.Any())
            {
                dbContext.Products.Add(new Product
                {
                    Name          = "Mountain Walkers",
                    Description   = "Use these sturdy shoes to pass any mountain range with ease.",
                    Price         = 219.5m,
                    Rating        = 4,
                    Type          = ProductType.Boots,
                    Stock         = 12,
                    PhotoFileName = "shutterstock_66842440.jpg",
                    IntroducedAt  = DateTimeOffset.Now.AddMonths(-1)
                });

                dbContext.Products.Add(new Product
                {
                    Name          = "Army Slippers",
                    Description   = "For your everyday marches in the army.",
                    Price         = 125.9m,
                    Rating        = 3,
                    Type          = ProductType.Boots,
                    Stock         = 56,
                    PhotoFileName = "shutterstock_222721876.jpg",
                    IntroducedAt  = DateTimeOffset.Now.AddMonths(-1)
                });

                dbContext.Products.Add(new Product
                {
                    Name          = "Backpack Deluxe",
                    Description   = "This backpack can survive any tornado.",
                    Price         = 199.99m,
                    Rating        = 5,
                    Type          = ProductType.ClimbingGear,
                    Stock         = 66,
                    PhotoFileName = "shutterstock_6170527.jpg",
                    IntroducedAt  = DateTimeOffset.Now.AddMonths(-1)
                });

                dbContext.Products.Add(new Product
                {
                    Name          = "Climbing Kit",
                    Description   = "Anything you need to climb the mount Everest.",
                    Price         = 299.5m,
                    Rating        = 5,
                    Type          = ProductType.ClimbingGear,
                    Stock         = 3,
                    PhotoFileName = "shutterstock_48040747.jpg",
                    IntroducedAt  = DateTimeOffset.Now.AddMonths(-1)
                });

                dbContext.Products.Add(new Product
                {
                    Name          = "Blue Racer",
                    Description   = "Simply the fastest kayak on earth and beyond for 2 persons.",
                    Price         = 350m,
                    Rating        = 5,
                    Type          = ProductType.Kayaks,
                    Stock         = 8,
                    PhotoFileName = "shutterstock_441989509.jpg",
                    IntroducedAt  = DateTimeOffset.Now.AddMonths(-1)
                });

                dbContext.Products.Add(new Product
                {
                    Name          = "Orange Demon",
                    Description   = "One person kayak with hyper boost button.",
                    Price         = 450m,
                    Rating        = 2,
                    Type          = ProductType.Kayaks,
                    Stock         = 1,
                    PhotoFileName = "shutterstock_495259978.jpg",
                    IntroducedAt  = DateTimeOffset.Now.AddMonths(-1)
                });

                dbContext.SaveChanges();
            }
        }