示例#1
0
        // Seed class used to populate db with initial data
        public static void Seed(AppDBContex context)
        {
            if (!context.Elephaitems.Any())
            {
                context.AddRange
                (
                    new Elephaitem {
                    Name = "Elephant My Sunshine T-shirt", Price = 12.99M, ShortDescription = "Grey Cotton T-shirt", LongDescription = "The graphic design is printed onto the shirt using our unique process. This process helps create the unique look of our shirts where the images appear to be part of the clothing instead of just pasted on. Our process provides customers with a superior product that ensures our clothing keeps looking good after surviving the onslaught from your washing machine and dryer.", ImageUrl = "https://scontent-lhr3-1.xx.fbcdn.net/v/t1.0-9/68964363_2313103368786978_2206298084042866688_n.jpg?_nc_cat=106&_nc_oc=AQl0beDLzPCW7jy-q6WlXIxz3n9slBVIhH3jmF9lCpsaOZo7AQ2yd6HDEW3UdOosXRJaNGh9GrRXsh4wQiC6NaJf&_nc_ht=scontent-lhr3-1.xx&oh=cb3dc4dacdea768988f6e469646bc41c&oe=5DCD5402", IsElephaitemOfTheWeek = true, ImageThumbnailUrl = "https://scontent-lhr3-1.xx.fbcdn.net/v/t1.0-9/68964363_2313103368786978_2206298084042866688_n.jpg?_nc_cat=106&_nc_oc=AQl0beDLzPCW7jy-q6WlXIxz3n9slBVIhH3jmF9lCpsaOZo7AQ2yd6HDEW3UdOosXRJaNGh9GrRXsh4wQiC6NaJf&_nc_ht=scontent-lhr3-1.xx&oh=cb3dc4dacdea768988f6e469646bc41c&oe=5DCD5402"
                },
                    new Elephaitem {
                    Name = "I love you to the Moon & back Mug", Price = 15.99M, ShortDescription = "Ceramic Mug", LongDescription = "Adding a splash of fun to your morning beverage, this lifelike Elephant Mug is artfully handcrafted in Thailand of durable earthenware. This unique and affordable piece will deliver big smiles even before the coffee is poured.", ImageUrl = "https://scontent-lhr3-1.xx.fbcdn.net/v/t1.0-9/15727311_1114880158609311_5170630230042243951_n.jpg?_nc_cat=102&_nc_oc=AQmEQshXZBFsNGlo5adVQnuQO1TXBinwose_9Ae1xhrnW0Ivt4lWIECOKHx3AzDj4PYeDvGEeFmbiKAVxaLtLwBK&_nc_ht=scontent-lhr3-1.xx&oh=719de032bab359aea1abf743e0887de0&oe=5DD480A9", IsElephaitemOfTheWeek = false, ImageThumbnailUrl = "https://scontent-lhr3-1.xx.fbcdn.net/v/t1.0-9/15727311_1114880158609311_5170630230042243951_n.jpg?_nc_cat=102&_nc_oc=AQmEQshXZBFsNGlo5adVQnuQO1TXBinwose_9Ae1xhrnW0Ivt4lWIECOKHx3AzDj4PYeDvGEeFmbiKAVxaLtLwBK&_nc_ht=scontent-lhr3-1.xx&oh=719de032bab359aea1abf743e0887de0&oe=5DD480A9"
                },
                    new Elephaitem {
                    Name = "Save the Elephants T-shirt", Price = 18.99M, ShortDescription = "White Cotton T-shirt", LongDescription = "This product is made-to-order and proudly printed with the best screenprinting or print to garment processes available. As such, it does not include embellishments such as rhinestones or glitter. ", ImageUrl = "https://scontent-lhr3-1.xx.fbcdn.net/v/t1.0-9/67417415_2269327536497895_6726561656240865280_n.jpg?_nc_cat=104&_nc_oc=AQkKCPI0X6pzMPLcCJWay-Kps-PbqMF3cOuxPkPg9qZnsI-a9Sa3-AzDcIzzUN0pwZfcDvvrskIz2RPIS9HNNsV-&_nc_ht=scontent-lhr3-1.xx&oh=484cd440a3dc7e3fb10ca40d43092bea&oe=5DD30E3C", IsElephaitemOfTheWeek = false, ImageThumbnailUrl = "https://scontent-lhr3-1.xx.fbcdn.net/v/t1.0-9/67417415_2269327536497895_6726561656240865280_n.jpg?_nc_cat=104&_nc_oc=AQkKCPI0X6pzMPLcCJWay-Kps-PbqMF3cOuxPkPg9qZnsI-a9Sa3-AzDcIzzUN0pwZfcDvvrskIz2RPIS9HNNsV-&_nc_ht=scontent-lhr3-1.xx&oh=484cd440a3dc7e3fb10ca40d43092bea&oe=5DD30E3C"
                },
                    new Elephaitem {
                    Name = "Elephant Beauty Phone Case", Price = 25.99M, ShortDescription = "Phone Case", LongDescription = "This case benefits from three card slots, for casual storage of a business card or travel ticket. There is also a hidden compartment for storage of a banknote. This case is not designed to replace a wallet or purse.", ImageUrl = "https://scontent-lhr3-1.cdninstagram.com/v/t51.2885-15/e35/66631511_2428710600518295_1242916115472403310_n.jpg?_nc_ht=scontent-lhr3-1.cdninstagram.com&se=7&oh=b25960f47f41758590271cad5d2b585a&oe=5DDAFAC5&ig_cache_key=MjA4OTAwMDg4MjM0NDgyNjUzNQ%3D%3D.2", IsElephaitemOfTheWeek = false, ImageThumbnailUrl = "https://scontent-lhr3-1.cdninstagram.com/v/t51.2885-15/e35/66631511_2428710600518295_1242916115472403310_n.jpg?_nc_ht=scontent-lhr3-1.cdninstagram.com&se=7&oh=b25960f47f41758590271cad5d2b585a&oe=5DDAFAC5&ig_cache_key=MjA4OTAwMDg4MjM0NDgyNjUzNQ%3D%3D.2"
                },
                    new Elephaitem {
                    Name = "Elephant and the bicycle T-shirt", Price = 13.50M, ShortDescription = "Yellow Cotton T-shirt", LongDescription = "The graphic design is printed onto the shirt using our unique process. This process helps create the unique look of our shirts where the images appear to be part of the clothing instead of just pasted on. Our process provides customers with a superior product that ensures our clothing keeps looking good after surviving the onslaught from your washing machine and dryer.", ImageUrl = "https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/67888237_2284716021625713_4139858181352325120_n.jpg?_nc_cat=102&_nc_oc=AQl1a2zoJvQHWpVPhIDzghjJ2_6l8pmuoQap6Fgfzt3U2P5FT_og8_2lIl9ByyMZLOU_f9gDgNNA_KUzme1e1uE4&_nc_ht=scontent-lht6-1.xx&oh=2104bfcfd4686f95e4365cc84cba753d&oe=5DD2F161", IsElephaitemOfTheWeek = true, ImageThumbnailUrl = "https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/67888237_2284716021625713_4139858181352325120_n.jpg?_nc_cat=102&_nc_oc=AQl1a2zoJvQHWpVPhIDzghjJ2_6l8pmuoQap6Fgfzt3U2P5FT_og8_2lIl9ByyMZLOU_f9gDgNNA_KUzme1e1uE4&_nc_ht=scontent-lht6-1.xx&oh=2104bfcfd4686f95e4365cc84cba753d&oe=5DD2F161"
                },
                    new Elephaitem {
                    Name = "To My Wife Canvas", Price = 19.99M, ShortDescription = "Canvas Print", LongDescription = "Designed to stay taut and flat, light in weight our canvas is mounted on high density wood fiberboard. Hard sealed finished backing keeps dust out and walls protected. Pigment-based inkjet printing ensure high quality printing. Comes with hardware, ready to hang", ImageUrl = "https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/51486707_2005835002847151_3020967704086446080_n.jpg?_nc_cat=104&_nc_oc=AQk8NbZnOTJKC1l09cpm22poTHlHE6JLJDpGbEq5oi0TfX4jmoQz8y4UItzjGtCfi8Hw6KmYbQHF5zXkb-j3L-mo&_nc_ht=scontent-lht6-1.xx&oh=5866794eaa1887d9c52065e8de2ab84b&oe=5E138907", IsElephaitemOfTheWeek = false, ImageThumbnailUrl = "https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/51486707_2005835002847151_3020967704086446080_n.jpg?_nc_cat=104&_nc_oc=AQk8NbZnOTJKC1l09cpm22poTHlHE6JLJDpGbEq5oi0TfX4jmoQz8y4UItzjGtCfi8Hw6KmYbQHF5zXkb-j3L-mo&_nc_ht=scontent-lht6-1.xx&oh=5866794eaa1887d9c52065e8de2ab84b&oe=5E138907"
                }

                );
                context.SaveChanges();
            }
        }
示例#2
0
 // we inject dbcontext
 // we use dbcontext to add feedback to database
 public FeedbackRepository(AppDBContex appDBContex)
 {
     _appDBContex = appDBContex;
 }
示例#3
0
 public ElephaitemRepository(AppDBContex appDBContex)
 {
     // local instanced eqial to the passed instance
     _appDbContext = appDBContex;
 }