public void Add(lib.Product product)
        {
            _logger.Info("Adding Product");

            Product entity = Mapper.MapLibProduct(product);

            _dbContext.Add(entity);
        }
        public Dictionary <lib.Product, int> GetAllProducts(int id)
        {
            var entity = _dbContext.OrderHistory
                         .Include(o => o.OrderLines)
                         .First(o => o.OrderId == id);
            Dictionary <lib.Product, int> orderLines = new Dictionary <lib.Product, int>();

            foreach (var item in entity.OrderLines)
            {
                var         product = _dbContext.Product.Find(item.ProductId);
                lib.Product p       = new lib.Product
                {
                    ProductId = product.ProductId,
                    Name      = product.ProductName,
                    Price     = product.Price
                };
                orderLines.Add(p, item.Amount);
            }
            return(orderLines);
        }