What is the best practice to insert differential records into the database using EF 4.0
I have a collection of Apartments in an object with 3 records.
Before inserting, I retrieve records from the database (Apartments Table) and brings back only 1 record. That 1 records happens to be 1 out of the 3 records in the objects above. I dont want to insert duplicate records.
I can remove the one different record and insert all 3 again...
Is there a better way of doing it? What is the best way of inserting only the 2 objects that are different to that table using EF?