예제 #1
0
        private void Seed(ShoppingCartDbContext context)
        {
            var item_1 = new ShoppingCartItem {
                ShoppingCartItemId = Guid.Parse("d28888e9-2ba9-473a-a40f-e38cb54f0101"), UserId = "d28888e9-2ba9-473a-a40f-e38cb54f0201", CatalogItemId = new Guid("90d6da79-e0e2-4ba8-bf61-2d94d90df801"), Amount = 1
            };
            var item_2 = new ShoppingCartItem {
                ShoppingCartItemId = Guid.Parse("d28888e9-2ba9-473a-a40f-e38cb54f0102"), UserId = "d28888e9-2ba9-473a-a40f-e38cb54f0201", CatalogItemId = new Guid("bfce20c2-22fa-4f73-bc07-54956cb52a02"), Amount = 2
            };

            context.AddRange(item_1, item_2);
            context.SaveChanges();
        }