Exemple #1
0
        private static void AddOperatingSystemsAndBrands(EcommerceContext context)
        {
            if (context.OS.Any() == false)
            {
                var os = new List <string>()
                {
                    "Android", "iOS", "Windows"
                };

                os.ForEach(o => context.OS.Add(new OS
                {
                    Name = o
                }));

                context.SaveChanges();
            }

            if (context.Brands.Any() == false)
            {
                var brands = new List <string>()
                {
                    "Acme", "Globex", "Soylent", "Initech", "Umbrella"
                };

                brands.ForEach(b => context.Brands.Add(new Brand
                {
                    Name = b
                }));

                context.SaveChanges();
            }
        }
Exemple #2
0
 public static void AddOperatingSystemsAndBrands(EcommerceContext context)
 {
     if (context.OSs.Any() == false)
     {
         var os = new List <string>()
         {
             "Android", "iOS", "Windows"
         };
         os.ForEach(o => context.OSs.Add(new OS
         {
             Name = o
         }));
         context.SaveChanges();
     }
     if (context.Brands.Any() == false)
     {
         var brands = new List <string> {
             "Samsung", "Sony", "Xiaomi", "HTC"
         };
         brands.ForEach(o => context.Brands.Add(new Brand
         {
             Name = o
         }));
         context.SaveChanges();
     }
 }
Exemple #3
0
        private static void AddColoursFeaturesAndStorage(EcommerceContext context)
        {
            if (context.Colours.Any() == false)
            {
                var colours = new List <string>()
                {
                    "Black", "White", "Gold", "Silver", "Grey", "Spacegrey", "Red", "Pink"
                };

                colours.ForEach(c => context.Add(new Colour
                {
                    Name = c
                }));

                context.SaveChanges();
            }

            if (context.Features.Any() == false)
            {
                var features = new List <string>()
                {
                    "3G", "4G", "Bluetooth", "WiFi", "Fast charge", "GPS", "NFC"
                };

                features.ForEach(f => context.Add(new Feature
                {
                    Name = f
                }));

                context.SaveChanges();
            }

            if (context.Storage.Any() == false)
            {
                var storage = new List <int>()
                {
                    4, 8, 16, 32, 64, 128, 256
                };

                storage.ForEach(s => context.Storage.Add(new Storage
                {
                    Capacity = s
                }));

                context.SaveChanges();
            }
        }
Exemple #4
0
 public static void AddColoursFeaturesAndStorage(EcommerceContext context)
 {
     if (context.Colours.Any() == false)
     {
         var colours = new List <string>()
         {
             "Black", "White", "Gold", "Silver", "Grey", "Spacegrey", "Red", "Pink"
         };
         colours.ForEach(c => context.Colours.Add(new Colour
         {
             Name = c
         }));
         context.SaveChanges();
     }
     if (context.Storages.Any() == false)
     {
         var storages = new List <string> {
             "32GB", "64GB"
         };
         storages.ForEach(c => context.Storages.Add(new Storage
         {
             Capacity = c
         }));
         context.SaveChanges();
     }
     if (context.Features.Any() == false)
     {
         var feautures = new List <string>()
         {
             "3G", "Bluetooth", "WiFi", "GPS"
         };
         feautures.ForEach(o => context.Features.Add(new Feature
         {
             Name = o
         }));
         context.SaveChanges();
     }
 }
 private static void AddProducts(EcommerceContext context)
 {
     if (context.Products.Any() == false)
     {
         var products = new List <Product>()
         {
             new Product
             {
                 Name             = "Samsung Galaxy S8",
                 Slug             = "samsung-galaxy-s8",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
                 Price            = 499.99M
             },
         };
         context.Products.AddRange(products);
         context.SaveChanges();
     }
 }
Exemple #6
0
 public static void AddProducts(EcommerceContext context)
 {
     if (!context.Products.Any())
     {
         var products = new List <Product>
         {
             new Product
             {
                 Name             = "Samsung Galaxy S8",
                 Slug             = "samsung-galaxy-s8",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Price            = 499.99M,
                 ScreenSize       = 5M,
                 TalkTime         = 8M,
                 StandbyTime      = 36M,
                 Brand            = context.Brands.Single(b => b.Name == "Samsung"),
                 OS     = context.OSs.Single(os => os.Name == "Android"),
                 Images = new List <Image>
                 {
                     new Image {
                         Url = "/assets/images/gallery1.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery2.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery3.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery4.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery5.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery6.jpeg"
                     }
                 },
                 ProductFeatures = new List <ProductFeature>
                 {
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "3G")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "Bluetooth")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "WiFi")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "GPS")
                     }
                 },
                 ProductVariants = new List <ProductVariant>
                 {
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 299M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 349M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 319M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 369M
                     }
                 }
             },
             new Product
             {
                 Name             = "Sony Xperia Z5",
                 Slug             = "sony-xperia-z5",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Price            = 499.99M,
                 ScreenSize       = 5M,
                 TalkTime         = 8M,
                 StandbyTime      = 36M,
                 Brand            = context.Brands.Single(b => b.Name == "Sony"),
                 OS     = context.OSs.Single(os => os.Name == "Android"),
                 Images = new List <Image>
                 {
                     new Image {
                         Url = "/assets/images/gallery1.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery2.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery3.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery4.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery5.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery6.jpeg"
                     }
                 },
                 ProductFeatures = new List <ProductFeature>
                 {
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "3G")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "Bluetooth")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "WiFi")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "GPS")
                     }
                 },
                 ProductVariants = new List <ProductVariant>
                 {
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 299M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 349M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 319M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 369M
                     }
                 }
             },
             new Product
             {
                 Name             = "Samsung Galaxy A7",
                 Slug             = "samsung-galaxy-a7",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Price            = 499.99M,
                 ScreenSize       = 5M,
                 TalkTime         = 8M,
                 StandbyTime      = 36M,
                 Brand            = context.Brands.Single(b => b.Name == "Samsung"),
                 OS     = context.OSs.Single(os => os.Name == "Android"),
                 Images = new List <Image>
                 {
                     new Image {
                         Url = "/assets/images/gallery1.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery2.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery3.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery4.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery5.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery6.jpeg"
                     }
                 },
                 ProductFeatures = new List <ProductFeature>
                 {
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "3G")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "Bluetooth")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "WiFi")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "GPS")
                     }
                 },
                 ProductVariants = new List <ProductVariant>
                 {
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 299M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 349M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 319M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 369M
                     }
                 }
             },
             new Product
             {
                 Name             = "HTC One Plus",
                 Slug             = "htc-one-plus",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Price            = 499.99M,
                 ScreenSize       = 5M,
                 TalkTime         = 8M,
                 StandbyTime      = 36M,
                 Brand            = context.Brands.Single(b => b.Name == "HTC"),
                 OS     = context.OSs.Single(os => os.Name == "Android"),
                 Images = new List <Image>
                 {
                     new Image {
                         Url = "/assets/images/gallery1.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery2.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery3.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery4.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery5.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery6.jpeg"
                     }
                 },
                 ProductFeatures = new List <ProductFeature>
                 {
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "3G")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "Bluetooth")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "WiFi")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "GPS")
                     }
                 },
                 ProductVariants = new List <ProductVariant>
                 {
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 299M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 349M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 319M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 369M
                     }
                 }
             },
             new Product
             {
                 Name             = "Xiaomi Mix 2S",
                 Slug             = "xiaomi-mix-2s",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Price            = 499.99M,
                 ScreenSize       = 5M,
                 TalkTime         = 8M,
                 StandbyTime      = 36M,
                 Brand            = context.Brands.Single(b => b.Name == "Xiaomi"),
                 OS     = context.OSs.Single(os => os.Name == "Android"),
                 Images = new List <Image>
                 {
                     new Image {
                         Url = "/assets/images/gallery1.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery2.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery3.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery4.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery5.jpeg"
                     },
                     new Image {
                         Url = "/assets/images/gallery6.jpeg"
                     }
                 },
                 ProductFeatures = new List <ProductFeature>
                 {
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "3G")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "Bluetooth")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "WiFi")
                     },
                     new ProductFeature
                     {
                         Feature = context.Features.Single(f => f.Name == "GPS")
                     }
                 },
                 ProductVariants = new List <ProductVariant>
                 {
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 299M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Black"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 349M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "32GB"),
                         Price   = 319M
                     },
                     new ProductVariant
                     {
                         Colour  = context.Colours.Single(c => c.Name == "Gold"),
                         Storage = context.Storages.Single(s => s.Capacity == "64GB"),
                         Price   = 369M
                     }
                 }
             }
         };
         context.Products.AddRange(products);
         context.SaveChanges();
     }
 }
Exemple #7
0
        private static void AddProducts(EcommerceContext context)
        {
            if (context.Products.Any() == false)
            {
                var products = new List <Product>()
                {
                    new Product
                    {
                        Name             = "Acme TNT 4",
                        Slug             = "acme-tnt-4",
                        Thumbnail        = "/assets/images/thumbnail.jpeg",
                        ShortDescription = "Acme TNT 4 Android smartphone with true edge to edge display",
                        Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                        ScreenSize       = 5M,
                        TalkTime         = 8M,
                        StandbyTime      = 36M,
                        Brand            = context.Brands.Single(b => b.Name == "Acme"),
                        OS     = context.OS.Single(os => os.Name == "Android"),
                        Images = new List <Image>
                        {
                            new Image {
                                Url = "/assets/images/gallery1.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery2.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery3.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery4.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery5.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery6.jpeg"
                            }
                        },
                        ProductFeatures = new List <ProductFeature>
                        {
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "3G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Bluetooth")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "WiFi")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "GPS")
                            }
                        },
                        ProductVariants = new List <ProductVariant>
                        {
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 299M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 349M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Gold"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 319M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Gold"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 369M
                            }
                        }
                    },
                    new Product
                    {
                        Name             = "Globex Scorpio",
                        Slug             = "globex-scorpio",
                        Thumbnail        = "/assets/images/thumbnail.jpeg",
                        ShortDescription = "Globex Scorpio Windows smartphone with true edge to edge display",
                        Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                        ScreenSize       = 7M,
                        TalkTime         = 6M,
                        StandbyTime      = 30M,
                        Brand            = context.Brands.Single(b => b.Name == "Globex"),
                        OS     = context.OS.Single(os => os.Name == "Windows"),
                        Images = new List <Image>
                        {
                            new Image {
                                Url = "/assets/images/gallery1.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery2.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery3.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery4.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery5.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery6.jpeg"
                            }
                        },
                        ProductFeatures = new List <ProductFeature>
                        {
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "3G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Bluetooth")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "WiFi")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "GPS")
                            }
                        },
                        ProductVariants = new List <ProductVariant>
                        {
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "White"),
                                Storage = context.Storage.Single(s => s.Capacity == 8),
                                Price   = 149M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "White"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 169M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 8),
                                Price   = 159M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 179M
                            }
                        }
                    },
                    new Product
                    {
                        Name             = "Soylent MegaFone",
                        Slug             = "soylent-megafone",
                        Thumbnail        = "/assets/images/thumbnail.jpeg",
                        ShortDescription = "Soylent MegaFone budget Android smartphone with true edge to edge display",
                        Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                        ScreenSize       = 5M,
                        TalkTime         = 10M,
                        StandbyTime      = 48M,
                        Brand            = context.Brands.Single(b => b.Name == "Soylent"),
                        OS     = context.OS.Single(os => os.Name == "Android"),
                        Images = new List <Image>
                        {
                            new Image {
                                Url = "/assets/images/gallery1.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery2.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery3.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery4.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery5.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery6.jpeg"
                            }
                        },
                        ProductFeatures = new List <ProductFeature>
                        {
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "3G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Bluetooth")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "WiFi")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "GPS")
                            }
                        },
                        ProductVariants = new List <ProductVariant>
                        {
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 4),
                                Price   = 99M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 8),
                                Price   = 119M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 139M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 4),
                                Price   = 99M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 8),
                                Price   = 119M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 139M
                            }
                        }
                    },
                    new Product
                    {
                        Name             = "Initech Silicon 5",
                        Slug             = "initech-silicon-5",
                        Thumbnail        = "/assets/images/thumbnail.jpeg",
                        ShortDescription = "Initech Silicon 5 premium iOS smartphone with true edge to edge display",
                        Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                        ScreenSize       = 4.7M,
                        TalkTime         = 8M,
                        StandbyTime      = 36M,
                        Brand            = context.Brands.Single(b => b.Name == "Initech"),
                        OS     = context.OS.Single(os => os.Name == "iOS"),
                        Images = new List <Image>
                        {
                            new Image {
                                Url = "/assets/images/gallery1.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery2.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery3.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery4.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery5.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery6.jpeg"
                            }
                        },
                        ProductFeatures = new List <ProductFeature>
                        {
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "3G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "4G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Bluetooth")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "WiFi")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "GPS")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Fast charge")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "NFC")
                            }
                        },
                        ProductVariants = new List <ProductVariant>
                        {
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 128),
                                Price   = 799M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 256),
                                Price   = 899M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 128),
                                Price   = 799M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 256),
                                Price   = 899M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 128),
                                Price   = 799M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 256),
                                Price   = 899M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 799M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 128),
                                Price   = 899M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 256),
                                Price   = 999M
                            }
                        }
                    },
                    new Product
                    {
                        Name             = "Umbrella T3",
                        Slug             = "umbrella-t3",
                        Thumbnail        = "/assets/images/thumbnail.jpeg",
                        ShortDescription = "Umbrella T3 premium Android smartphone with true edge to edge display",
                        Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                        ScreenSize       = 5.5M,
                        TalkTime         = 8M,
                        StandbyTime      = 36M,
                        Brand            = context.Brands.Single(b => b.Name == "Umbrella"),
                        OS     = context.OS.Single(os => os.Name == "Android"),
                        Images = new List <Image>
                        {
                            new Image {
                                Url = "/assets/images/gallery1.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery2.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery3.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery4.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery5.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery6.jpeg"
                            }
                        },
                        ProductFeatures = new List <ProductFeature>
                        {
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "3G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "4G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Bluetooth")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "WiFi")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "GPS")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Fast charge")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "NFC")
                            }
                        },
                        ProductVariants = new List <ProductVariant>
                        {
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 499M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 499M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Silver"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 499M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Grey"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 499M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Spacegrey"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Red"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 499M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Red"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Red"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Pink"),
                                Storage = context.Storage.Single(s => s.Capacity == 16),
                                Price   = 499M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Pink"),
                                Storage = context.Storage.Single(s => s.Capacity == 32),
                                Price   = 599M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Pink"),
                                Storage = context.Storage.Single(s => s.Capacity == 64),
                                Price   = 699M
                            }
                        }
                    }
                };

                context.Products.AddRange(products);
                context.SaveChanges();
            }
        }
        private static void AddProducts(EcommerceContext context)
        {
            if (context.Products.Any() == false)
            {
                var products = new List <Product>()
                {
                    new Product
                    {
                        Name             = "Samsung Galaxy S8",
                        Slug             = "samsung-galaxy-s8",
                        Thumbnail        = "http://placehold.it/200x300",
                        ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                        Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                        Price            = 499.99M,
                        ScreenSize       = 5M,
                        TalkTime         = 8M,
                        StandbyTime      = 36M,
                        Brand            = context.Brands.Single(b => b.Name == "Acme"),
                        OS     = context.OS.Single(os => os.Name == "Android"),
                        Images = new List <Image>
                        {
                            new Image {
                                Url = "/assets/images/gallery1.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery2.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery3.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery4.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery5.jpeg"
                            },
                            new Image {
                                Url = "/assets/images/gallery6.jpeg"
                            }
                        },
                        ProductFeatures = new List <ProductFeature>
                        {
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "3G")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "Bluetooth")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "WiFi")
                            },
                            new ProductFeature
                            {
                                Feature = context.Features.Single(f => f.Name == "GPS")
                            }
                        },
                        ProductVariants = new List <ProductVariant>
                        {
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == "32GB"),
                                Price   = 299M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Black"),
                                Storage = context.Storage.Single(s => s.Capacity == "64GB"),
                                Price   = 349M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Gold"),
                                Storage = context.Storage.Single(s => s.Capacity == "32GB"),
                                Price   = 319M
                            },
                            new ProductVariant
                            {
                                Colour  = context.Colours.Single(c => c.Name == "Gold"),
                                Storage = context.Storage.Single(s => s.Capacity == "64GB"),
                                Price   = 369M
                            }
                        }
                    }/*,
                      * new Product
                      * {
                      * Name = "Samsung Galaxy S9",
                      * Slug = "samsung-galaxy-s9",
                      * Thumbnail = "http://placehold.it/200x300",
                      * ShortDescription = "Samsung Galaxy S9 Android smartphone with true edge to edge display",
                      * Description = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                      * Price = 499.99M,
                      * ScreenSize = 5M,
                      * TalkTime = 8M,
                      * StandbyTime = 36M,
                      * Brand = context.Brands.Single(b => b.Name == "Acme"),
                      * OS = context.OS.Single(os => os.Name == "Android"),
                      * Images = new List<Image>
                      * {
                      *     new Image { Url = "/assets/images/gallery1.jpeg" },
                      *     new Image { Url = "/assets/images/gallery2.jpeg" },
                      *     new Image { Url = "/assets/images/gallery3.jpeg" },
                      *     new Image { Url = "/assets/images/gallery4.jpeg" },
                      *     new Image { Url = "/assets/images/gallery5.jpeg" },
                      *     new Image { Url = "/assets/images/gallery6.jpeg" }
                      * },
                      * ProductFeatures = new List<ProductFeature>
                      * {
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "3G")
                      *     },
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "Bluetooth")
                      *     },
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "WiFi")
                      *     },
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "GPS")
                      *     }
                      * },
                      * ProductVariants = new List<ProductVariant>
                      * {
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Black"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "32GB"),
                      *         Price = 299M
                      *     },
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Black"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "64GB"),
                      *         Price = 349M
                      *     },
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Gold"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "32GB"),
                      *         Price = 319M
                      *     },
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Gold"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "64GB"),
                      *         Price = 369M
                      *     }
                      * }
                      * },
                      * new Product
                      * {
                      * Name = "Samsung Galaxy S10",
                      * Slug = "samsung-galaxy-s10",
                      * Thumbnail = "http://placehold.it/200x300",
                      * ShortDescription = "Samsung Galaxy S10 Android smartphone with true edge to edge display",
                      * Description = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                      * Price = 499.99M,
                      * ScreenSize = 5M,
                      * TalkTime = 8M,
                      * StandbyTime = 36M,
                      * Brand = context.Brands.Single(b => b.Name == "Acme"),
                      * OS = context.OS.Single(os => os.Name == "Android"),
                      * Images = new List<Image>
                      * {
                      *     new Image { Url = "/assets/images/gallery1.jpeg" },
                      *     new Image { Url = "/assets/images/gallery2.jpeg" },
                      *     new Image { Url = "/assets/images/gallery3.jpeg" },
                      *     new Image { Url = "/assets/images/gallery4.jpeg" },
                      *     new Image { Url = "/assets/images/gallery5.jpeg" },
                      *     new Image { Url = "/assets/images/gallery6.jpeg" }
                      * },
                      * ProductFeatures = new List<ProductFeature>
                      * {
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "3G")
                      *     },
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "Bluetooth")
                      *     },
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "WiFi")
                      *     },
                      *     new ProductFeature
                      *     {
                      *         Feature = context.Features.Single(f => f.Name == "GPS")
                      *     }
                      * },
                      * ProductVariants = new List<ProductVariant>
                      * {
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Black"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "32GB"),
                      *         Price = 299M
                      *     },
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Black"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "64GB"),
                      *         Price = 349M
                      *     },
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Gold"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "32GB"),
                      *         Price = 319M
                      *     },
                      *     new ProductVariant
                      *     {
                      *         Colour = context.Colours.Single(c => c.Name == "Gold"),
                      *         Storage = context.Storage.Single(s => s.Capacity == "64GB"),
                      *         Price = 369M
                      *     }
                      * }
                      * }*/
                };

                context.Products.AddRange(products);
                context.SaveChanges();
            }
        }
 private static void AddProducts(EcommerceContext context)
 {
     if (context.Products.Any() == false)
     {
         var products = new List <Product>()
         {
             new Product
             {
                 Name             = "Samsung Galaxy S8",
                 Slug             = "samsung-galaxy-s8",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                 Price            = 499.99M
             },
             new Product
             {
                 Name             = "HTC U11",
                 Slug             = "htc-u11",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "HTC U11 Android smartphone with built-in Amazon Alexa",
                 Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                 Price            = 509.99M
             },
             new Product
             {
                 Name             = "Apple iPhone X",
                 Slug             = "apple-iphone-x",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Apple iPhone X smartphone with super retina display",
                 Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                 Price            = 999.99M
             },
             new Product
             {
                 Name             = "Samsung Galaxy S8",
                 Slug             = "samsung-galaxy-s8-2",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Samsung Galaxy S8 Android smartphone with true edge to edge display",
                 Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                 Price            = 499.99M
             },
             new Product
             {
                 Name             = "HTC U11",
                 Slug             = "htc-u11-2",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "HTC U11 Android smartphone with built-in Amazon Alexa",
                 Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                 Price            = 509.99M
             },
             new Product
             {
                 Name             = "Apple iPhone X",
                 Slug             = "apple-iphone-x-2",
                 Thumbnail        = "http://placehold.it/200x300",
                 ShortDescription = "Apple iPhone X smartphone with super retina display",
                 Description      = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis tempora ad cum laudantium, omnis fugit amet iure animi corporis labore repellat magnam perspiciatis explicabo maiores fuga provident a obcaecati tenetur nostrum, quidem quod dignissimos, voluptatem quasi? Nisi quaerat, fugit voluptas ducimus facilis impedit quod dicta, laborum sint iure nihil veniam aspernatur delectus officia culpa, at cupiditate? Totam minima ut deleniti laboriosam dolores cumque in, nesciunt optio! Quod recusandae voluptate facere pariatur soluta vel corrupti tenetur aut maiores, cumque mollitia fugiat laudantium error odit voluptas nobis laboriosam quo, rem deleniti? Iste quidem amet perferendis sed iusto tempora modi illo tempore quibusdam laborum? Dicta aliquam libero, facere, maxime corporis qui officiis explicabo aspernatur non consequatur mollitia iure magnam odit enim. Eligendi suscipit, optio officiis repellat eos quis iure? Omnis, error aliquid quibusdam iste amet nihil nisi cumque magni sequi enim illo autem nesciunt optio accusantium animi commodi tenetur neque eum vitae est.",
                 Price            = 999.99M
             }
         };
         context.Products.AddRange(products);
         context.SaveChanges();
     }
 }