Databinding, ObjectContainerDatasource and EF

Topics: Web Client Software Factory
Jun 19, 2009 at 8:37 AM


What is the best practice in order to achieve the following using a WebUI.

So for example I have an EF model which has employees and departments which are associated. So my employee class has a reference to a collection of departments. When binding this to a Detailsview for example I can create an Item Template to display the dropdown list of departments etc. But what to I bind the dropdown list to as I won't have the "departmentId" property in my Employee class?

I've seen a worked around for this where you create a partial class with the departmentId property, but this seems a bit messy. Is there a more elegant way to approach this?

Thanks and kind regards