If I want to use an ORM service, are these my only two options?
-
using generic ORM service and manually specifying entity type each time
-
implementing a custom virtual entity service
Or, is there a way to specify the entity type when auto wiring?
-Ben
In your Wirebox config you could also specify it like this:
map("ServiceName")
.toDSL("entityService:EntityName")
.asSingleton();
Then wherever you need to use it just do:
<cfproperty name="ServiceName" inject="model">
The benefit of doing it like this is that if you one day move to a
concrete service, you just change it in your Wirebox config instead of
changing it in every object that depends on it.