How can I get this method to work? Is there a different method that I should be using?
Product testProduct = new Product();
testProduct = products[0];
var _productRepository = EngineContext.Current.Resolve<IRepository<Product>>();
var _productService = EngineContext.Current.Resolve<IProductService>();
var skuFound = _productService.GetProductBySku(testProduct.Sku);
if (skuFound.Sku != null)
{
_productService.UpdateProduct(testProduct);
}
else
{
_productRepository.Insert(testProduct);
}