I'm using version 2, adapter, ASP.NET 2.0, targeting SQL Server 2000
I have a line item related to a product. I want to assign the product to the item.Product property and have it either create a new product (if I've created a new product object), or just refer to the product identifier (if I've fetched an existing product) when the parent LineItem is saved. Is this possible?
I'm using the following adapter over-ride:
order.Product = product; // this is either a newly created product or a fetched product
adapter.SaveEntity( order, false, true);
It creates the new products just fine, but if I've found an existing product (using adapter.FetchEntity( product ), after assigning the primary key), it still tries to create a new product.
Thanks in advance!