I'm having some problems with retrieving my Project entity in the EntityFramework. It keeps giving me the Objest instance has been disposed error.
I've got 2 instances, as seen in the image below.
And the following code gives me the error:
public Project GetProjectyById(int id)
{
using (var context = new CoderaDBEntities())
{
return context.Projects.First(c => c.Id == id);
}
}
Everything from Project is retrieved fine, but the Category object inside the Project object (the association) delivers me the object has been disposed error. What's going on?
Thanks!
Edit: Does this association look odd to you?