public void Insert(BusinessObjects.Product entity)
        {
            // Get the highest Id for the Products and increment it,
            // then assign it to the new entity before adding to the repository.
            var maxId = _products.Select(c => c.id).Max();

            entity.id = maxId + 1;

            _products.Add(entity);
        }
        public void Update(BusinessObjects.Product entityToUpdate)
        {
            Product product = _products.Where(p => p.id == entityToUpdate.id).SingleOrDefault();

            product.Name  = entityToUpdate.Name;
            product.Price = entityToUpdate.Price;
            product.Category.CategoryName = entityToUpdate.Category.CategoryName;
            product.Category.id           = entityToUpdate.Category.id;

            // Update the repository here.
        }
        public static BusinessObjects.Product To_BO(DataAccessLayer.Product productDAO)
        {
            BusinessObjects.Product productBO = new BusinessObjects.Product();

            productBO.ID = productDAO.ID;
            productBO.Name = productDAO.Name;
            productBO.Description = productDAO.Description;
            productBO.Price = productDAO.Price;
            productBO.Stock = productDAO.Stock;
            productBO.CategoryID = productDAO.CategoryID;
            productBO.EntryDate = productDAO.EntryDate;
            productBO.ExpirationDate = productDAO.ExpirationDate;

            if(productDAO.Category != null)
            {
                productBO.Category = CategoryMapper.To_BO(productDAO.Category);
            }
            return productBO;
        }
 public void Delete(BusinessObjects.Product entityToDelete)
 {
 }