示例#1
0
        private static void MigrateProductsTable(ProductContext productContext,
                                                 SupermarketContext supermarketContext)
        {
            var productTable     = productContext.Products;
            var supermarketTable = supermarketContext.Products;

            foreach (var item in productTable)
            {
                var newItem = new Product.Model.Product()
                {
                    Id = item.Id, VendorId = item.VendorId, ProductName = item.ProductName, MeasureId = item.MeasureId, BasePrice = item.BasePrice
                };
                supermarketTable.Add(newItem);
            }
        }
示例#2
0
 public void Add(Model.Product product)
 {
     Products.Add(product.Name, product);
 }