예제 #1
0
        public Product GetById(int id)
        {
            ProductLegacy legacyProduct = GetLegacyProduct(id);
            Product       product       = MapLegacyProduct(legacyProduct);

            return(product);
        }
예제 #2
0
        private Product MapLegacyProduct(ProductLegacy legacyProduct)
        {
            if (legacyProduct.WT == null && legacyProduct.WT_KG == null)
            {
                throw new Exception("Invalid weight in product: " + legacyProduct.NMB_CM);
            }

            double weightInPounds = legacyProduct.WT ?? legacyProduct.WT_KG.Value * PoundsInKilogram;

            return(null); // new Product(legacyProduct.NMB_CM, weightInPounds);
        }