I have been working on a application that only has one entity manager. When I attempted to add another one (something that should be relatively easy) everything went Nuclear! My assumption that GetDefaultEntityManager was some sort of a attempted singleton pattern was way off. I don't even know why it has a generic parameter, it does not seem to use it O_o?
What is the intended usage pattern for working with multiple entity managers? If you look at the code everything just seems wrong. Entity Manager defines the following property in the base class:
public static EntityManager DefaultManager { get; set; }
But then it goes and generates this:
/// <summary>Gets the default manager. </summary>
public new static IdentityEntityManager DefaultManager
{
get { return GetDefaultEntityManager<IdentityEntityManager>(); }
}
Now it looks correct, but GetDefaultEntityManager just fetches the very first entitymanger you worked with regardless of the generic paramter specified. I have searched the forum, noone is complaining so that leads me to believe I am missing something.
Should I have just instantiated my entity managers explicitly somewhere in my code with a proper singleton pattern from the getgo? Or is there a way in which I can recover without having to go through all my code and rip out all the references to DefaultManager. This is not cool.
DevForce is such a phenomenal piece of software, but every now and again you get these weird and blatently broken pieces of functionality that makes no sense. How can you code something like DevForce but get such basic things wrong!?
Edited by pompomJuice - 26-Nov-2010 at 5:05am