public static void Initial(AppDBContent content) { if (!content.Category.Any()) { content.Category.AddRange(Categories.Select(c => c.Value)); } if (!content.Good.Any()) { content.AddRange( new Goods { name = "Chair №001", shortDesc = "White Modern Chair", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/1.jpg", price = 40, isFavourite = true, available = true, Category = Categories["Chairs"] }, new Goods { name = "Succulent Plant", shortDesc = "White Brazil succulent", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/2.jpg", price = 15, isFavourite = true, available = true, Category = Categories["Accesoires"] }, new Goods { name = "Combo Amado", shortDesc = "White Ikea Chair and cart", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/3.jpg", price = 100, isFavourite = true, available = true, Category = Categories["Furniture"] }, new Goods { name = "Cactus Orgo", shortDesc = "Mexico cactus", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/4.jpg", price = 19, isFavourite = true, available = true, Category = Categories["Accesoires"] }, new Goods { name = "Succulent Aurora", shortDesc = "Mexico succulent", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/5.jpg", price = 10, isFavourite = true, available = true, Category = Categories["Accesoires"] }, new Goods { name = "White Table №014", shortDesc = "Table Colley from white wood", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/6.jpg", price = 60, isFavourite = true, available = true, Category = Categories["Tables"] }, new Goods { name = "Chair №008", shortDesc = "White loft chair", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/7.jpg", price = 25, isFavourite = true, available = true, Category = Categories["Chairs"] }, new Goods { name = "Rocking chair №002", shortDesc = "White rocking chair Amelia", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/8.jpg", price = 40, isFavourite = true, available = true, Category = Categories["Chairs"] }, new Goods { name = "Cactus Orgo", shortDesc = "Mexico cactus", longDesc = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid quae eveniet culpa officia quidem mollitia impedit iste asperiores nisi reprehenderit consequatur, autem, nostrum pariatur enim?", img = "/img/bg-img/99.jpg", price = 19, isFavourite = true, available = true, Category = Categories["Accesoires"] } ); } content.SaveChanges(); }
public static void initial(AppDBContent content) { if (!content.Category.Any()) { content.Category.AddRange(Categories.Select(c => c.Value)); } if (!content.Car.Any()) { content.AddRange( new Car { name = "Tesla Model 5", shortDesc = "Быстрый автомобиль", longDesc = "Крассный, быстрый и очень тихий автомобиль", img = "/img/tesla.jpg", price = 45000, isFavorite = true, available = true, Category = Categories["Электромобили"] }, new Car { name = "Ford Fiesta", shortDesc = "Тихий и спокойный", longDesc = "Удобный автомобиль для городской жизни", img = "/img/Ford.png", price = 11000, isFavorite = false, available = true, Category = Categories["Классический"] }, new Car { name = "BMV M3", shortDesc = "Спортивный", longDesc = "Быстрый, черный и крассивый", img = "/img/BMV.jpg", price = 65000, isFavorite = true, available = true, Category = Categories["Классический"] }, new Car { name = "Mersedes C class", shortDesc = "Уютный", longDesc = "Уютный и большой", img = "/img/Mersedes.jpg", price = 40000, isFavorite = false, available = false, Category = Categories["Классический"] }, new Car { name = "Nissan Leaf", shortDesc = "Бесшумный", longDesc = "Бесшумный и удобный", img = "/img/Nissan.jpg", price = 14000, isFavorite = true, available = true, Category = Categories["Электромобили"] } ); } content.SaveChanges(); }
public static void Initial(AppDBContent content) { if (!content.Category.Any()) { content.Category.AddRange(Categories.Select(c => c.Value)); } if (!content.Car.Any()) { content.AddRange( new Car { Name = "Tesla", ShortDesk = "Электоавтомобиль", LongDesk = "Красивый быстрый и очень тихий, автомобиль премиум класса", Img = "https://i0.wp.com/itc.ua/wp-content/uploads/2019/06/Tesla-Model-S-2gen.jpg?w=1280&quality=100&strip=all&ssl=1", Price = 45000, IsFavourite = false, AvaiLable = true, Category = Categories["Электромобили"] }, new Car { Name = "Audi E-tron", ShortDesk = "Электоавтомобиль", LongDesk = "Красивый быстрый и очень тихий, автомобиль премиум класса от концерна Audi", Img = "https://img.drive.ru/i/0/5ba01408ec05c4bb2c00002b.jpg", Price = 55000, IsFavourite = true, AvaiLable = true, Category = Categories["Электромобили"] }, new Car { Name = "BMW-M3", ShortDesk = "Класический автомобиль", LongDesk = "Красивый быстрый и очень быстрый , автомобиль премиум класса от концерна BMW", Img = "https://kolesa-uploads.ru/-/e292722e-bb3d-41af-8770-3cfaf1cffaa5/bmw-m3-new-front2.jpg", Price = 55000, IsFavourite = false, AvaiLable = true, Category = Categories["Классические авто"] }, new Car { Name = "Toyota Camry", ShortDesk = "Класический автомобиль", LongDesk = "Красивый семейный и очень надежный, автомобиль М класса от концерна Toyota", Img = "https://autoreview.ru/images/gallery/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8/2020/July/15/Toyota-Camry-XSE.jpg", Price = 35000, IsFavourite = true, AvaiLable = true, Category = Categories["Классические авто"] }, new Car { Name = "Lada Vesta", ShortDesk = "Класический автомобиль", LongDesk = "Авто не очень, но для народа", Img = "https://wroom.ru/i/cars2/lada_vestasport_1.jpg", Price = 15000, IsFavourite = false, AvaiLable = true, Category = Categories["Классические авто"] }, new Car { Name = "Lexus IS", ShortDesk = "Класический автомобиль", LongDesk = "Бизнес сидан проверенный временем,красывый и надежный ", Img = "https://avatars.mds.yandex.net/get-verba/1540742/2a00000172e05234923ed4d26fb64459e42a/cattouchret", Price = 49000, IsFavourite = true, AvaiLable = true, Category = Categories["Классические авто"] } ); } content.SaveChanges(); }
public static void Initial(AppDBContent content) { if (!content.Category.Any()) { content.Category.AddRange(Categories.Select(c => c.Value)); } if (!content.Electronics.Any()) { content.AddRange( new Electronic { name = "Samsung", shortDesk = "Смартфон Samsung Galaxy S20 128GB красный [G980F]", longDesk = "Android, экран 6.2 AMOLED (1440x3200), Exynos 990, ОЗУ 8 ГБ, флэш-память 128 ГБ, карты памяти, камера 12 Мп, аккумулятор 4000 мАч, 2 SIM", img = "/img/samsung6.HTEFS.jpg", price = 2675, isFavourite = true, available = true, Category = Categories["Премиум"] }, new Electronic { name = "Huawei", shortDesk = "Смартфон HUAWEI P40 Pro 128GB серебристый ", longDesk = "Android, экран 6.2 AMOLED (1440x3200), Exynos 990, ОЗУ 8 ГБ, флэш-память 128 ГБ, карты памяти, камера 12 Мп, аккумулятор 4000 мАч, 2 SIM", img = "/img/huawei.vIuqs.jpg", price = 2300, isFavourite = true, available = true, Category = Categories["Премиум"] }, new Electronic { name = "Samsung", shortDesk = "Смартфон Galaxy A30s Flip 128GB серебристый ", longDesk = "Android, экран 6.2 AMOLED (1440x3200), Exynos 990, ОЗУ 8 ГБ, флэш-память 128 ГБ, карты памяти, камера 12 Мп, аккумулятор 4000 мАч, 2 SIM", img = "/img/samsung1.GTRL2.jpeg", price = 700, isFavourite = true, available = true, Category = Categories["Бюджетные Смртфоны"] }, new Electronic { name = "Samsung", shortDesk = "Смартфон Galaxy A71 Flip 128GB серебристый ", longDesk = "Android, экран 6.2 AMOLED (1440x3200), Exynos 990, ОЗУ 8 ГБ, флэш-память 128 ГБ, карты памяти, камера 12 Мп, аккумулятор 4000 мАч, 2 SIM", img = "/img/samsung2.nhD6Q.jpg", price = 1100, isFavourite = true, available = true, Category = Categories["Бюджетные Смртфоны"] }, new Electronic { name = "Samsung", shortDesk = "Смартфон Galaxy A71 Flip 128GB серебристый ", longDesk = "Android, экран 6.2 AMOLED (1440x3200), Exynos 990, ОЗУ 8 ГБ, флэш-память 128 ГБ, карты памяти, камера 12 Мп, аккумулятор 4000 мАч, 2 SIM", img = "/img/samsung3.rKMz9.jpeg", price = 1100, isFavourite = true, available = true, Category = Categories["Бюджетные Смртфоны"] }, new Electronic { name = "Samsung", shortDesk = "Смартфон Galaxy A71 Flip 128GB серебристый ", longDesk = "Android, экран 6.2 AMOLED (1440x3200), Exynos 990, ОЗУ 8 ГБ, флэш-память 128 ГБ, карты памяти, камера 12 Мп, аккумулятор 4000 мАч, 2 SIM", img = "/img/samsung4.lc9Aq.jpeg", price = 1100, isFavourite = true, available = true, Category = Categories["Бюджетные Смртфоны"] }, new Electronic { name = "Samsung", shortDesk = "Смартфон Galaxy A71 Flip 128GB серебристый ", longDesk = "Android, экран 6.2 AMOLED (1440x3200), Exynos 990, ОЗУ 8 ГБ, флэш-память 128 ГБ, карты памяти, камера 12 Мп, аккумулятор 4000 мАч, 2 SIM", img = "/img/samsung7.H6BlC.jpg", price = 1100, isFavourite = true, available = true, Category = Categories["Бюджетные Смртфоны"] } ); } content.SaveChanges(); }
public CategoryRepository(AppDBContent appDBContent) { this.appDBContent = appDBContent; }
public static void Initial(AppDBContent content) { if (!content.Category.Any()) { content.Category.AddRange(Categories.Select(c => c.Value)); } if (!content.Car.Any()) { content.AddRange( new Car { Name = "Tesla", ShortDesc = "Быстрый автомобиль", LongDesc = "Красивый, быстрый очень тихий автомобиль", Img = "/img/tesla.jpg", Price = 45000, IsFavorite = true, Available = true, Category = Categories["Электромобили"] }, new Car { Name = "Ford Fiesta", ShortDesc = "Тихий и спокойный", LongDesc = "Удобный автомобиль для городской жизни", Img = "/img/fiesta.jpg", Price = 11000, IsFavorite = false, Available = true, Category = Categories["Классические автомобили"] }, new Car { Name = "BMW M3", ShortDesc = "Дерзкий и стильный", LongDesc = "Удобный автомобиль для городской жизни", Img = "/img/bmw.jpg", Price = 60000, IsFavorite = true, Available = true, Category = Categories["Классические автомобили"] }, new Car { Name = "Mercedes S Class", ShortDesc = "Большой и удобный", LongDesc = "Удобный автомобиль для городской жизни", Img = "/img/mercedes.jpg", Price = 65000, IsFavorite = false, Available = false, Category = Categories["Классические автомобили"] }, new Car { Name = "Nissan Leaf", ShortDesc = "Бесшумный и экономный", LongDesc = "Удобный автомобиль для городской жизни", Img = "/img/leaf.jpg", Price = 14000, IsFavorite = true, Available = true, Category = Categories["Электромобили"] } ); } content.SaveChanges(); }
public static void Initial(AppDBContent content) { if (!content.Category.Any()) { content.Category.AddRange(Categories.Select(c => c.Value)); } if (!content.Car.Any()) { content.AddRange( new Car { name = "Tesla Model S", shortDesc = "Быстрый электрокар", longDesc = "Красивый, быстрый и очень тихий автомобиль компании Tesla", img = "/img/Tesla.jpg", price = 45000, isFavourite = true, available = true, Category = Categories["Электромобили"] }, new Car { name = "Ford Fiesta", shortDesc = "Тихий и спокойный", longDesc = "Удобный автомобиль для городской жизни", img = "/img/Ford.jpg", price = 11000, isFavourite = false, available = true, Category = Categories["Классические автомобили"] }, new Car { name = "BMW M3", shortDesc = "Дерзкий и стильный", longDesc = "Удобный автомобиль для городской жизни", img = "/img/BMW.jpg", price = 65000, isFavourite = true, available = true, Category = Categories["Классические автомобили"] }, new Car { name = "Mercedes C class", shortDesc = "Уютный и большой", longDesc = "Удобный амтомобиль для городской жизни", img = "/img/Mercedes.jpg", price = 40000, isFavourite = false, available = false, Category = Categories["Классические автомобили"] }, new Car { name = "Nissan Leaf", shortDesc = "Уютный и большой", longDesc = "Удобный амтомобиль для городской жизни", img = "/img/nissan.jpg", price = 14000, isFavourite = true, available = true, Category = Categories["Электромобили"] } ); } content.SaveChanges(); }