views:

38

answers:

0

First I come from a nettiers background. And I really think that is getting in the way of trying to figure out how to use EF4.

Second. I am using the POCO templates available from MS. I have lazy loading enabled as well as proxy generation.

in my application I am eagerloading an selected doctors information from my users selection:

doc = _context.Doctors.
            Include("DoctorHome").
            Include("DoctorLicense").
            Include("DoctorOffices").
            Include("DoctorTaxonomies").Where(Function(d) d.ID = doc.ID).FirstOrDefault()

This is happening in a service class that is setup as a singleton with the Datacontext defined as a classlevel field.

dim _context as Datacontext(actual name of container is different)

Currently I am trying to edit an Icollection of Contactinfo that is a navigation property of DoctorHome. This happens thru an event that publishes the child collection of DoctorHome for the ViewModel to grab and allow editing.

I am trying to granularly save or cancel edits to each associated Item of the doctor.

So there is a screen for doctor offices, doctor Licenses..I can get the items to behave, but its the grandchildren of them that seem to be causeing me issues and they are the most important to get fixed. I guess I 'could' eagerload contactinfo table as well, but its used by both doctorhome and doctoroffice depending on contacttype...maybe that wont make a difference.

if you need more coherent information just ask. I have found alot of information about POCOS but none of it seems to address my problem.