Not a very experienced EF guy so thought I would ask the experts on this one.
I have an entity call "Applicant". An Applicant can have many "Applications".
I have a typical method that searches for an Applicant. If the Applicant exists it is updated, else it is added. At the same time a new Application is added in both cases.
I have 2 ways I can do this:
1) Create or Update the Applicant and create an Application separately immediately afterwards. 2) Create or Update the Applicant but add the Application to the Applications Collection (of the Applicant).
The question I have relates to option 2. When I retrieve an Applicant from the database and it exists, I then add my new Application to its collection. When I update the Applicant does it do an update for each item in its collection or is it intelligent enough to know I've only added 1 new Application? In other words, am I making unecessary round trips to the database?
Hope it makes sense.
Using EF 4.3.1.
Thanks in advance.