My entities classes are all descendants from a base class, that I use as a way to initialize context values.
This is not Table Inheritance, just normal class inheritance.
My question is that since those objects can be created by Aurelius, I donÂ´t know how to use dependency Injection and give to the created object my IContext interface to let it know the values to be used on the created context.
Let me explain, for example, if the user is working with company = 1, then anything that will be created, a new item, a new customer, will have the property company = 1
On the old days :) we used this by accessing global variables, or singletons for that.
However, since I am using unit testing, and global variables are evil, I prefer to follow the DI patter.
Another problem is that when using web I can eventually many threads running, and I cannot depend on singletons for these kind of thing.
Is there anything on Aurelius that I could depend on when the object is constructed to reference it, specially new empty ones.
I cannot rely on the TAureliusDataset only, since this is part of the view and is kept dumbest possible. I need to implement on my model layer and that deals with the non-component stuff.
I need to give to new created entities my IContext interface, and that needs to be on the same context of the manager, since there is this multi-threading, and I keep total separation between threads.
Appreciate any help....