I have to following problem. I've large collection of XML files. In each XML file there are different employees. I have to add the unique employees to the database. In the database each employee has first name, last name and birth date. I want to check whether employee with the same properties already exists in the database and if it doesn't to insert it.
I'm using the following code:
Entities entities;
entities.AddToEmployee(emp);
entities.SaveChanges();
My employee is connected with another data structure - sales. So I need to add just the employee's primary key to the sales table but not the whole employee in the database (in case that it already exists).
Thanks in advance!