Example #1
0
 private static bool HasDifferences(Product product, Product productInDatabase)
 {
     return true; // product.Price != productInDatabase.Price;
 }
Example #2
0
 private Product ProductTask(Product product, IEnumerable<Product> products)
 {
     var productInDatabase = products.FirstOrDefault(x => x.Code == product.Code);
     if (productInDatabase == null) return product;
     if (HasDifferences(product, productInDatabase))
     {
         product.Id = productInDatabase.Id;
         product.OldPrice = productInDatabase.Price;
         return product;
     }
     return null;
 }