I'd like to use ObjectDataSource with an instance that implements IRepository. I'd also like to be able to flexibly change the IRepository implementation through dependency injection, and switch between one that uses ORM and a fake.
I currently don't see a way to do this because the ODS points to a class instead of an instance. Is there a way around this?
I'm looking along the lines of having a data source class that calls a factory that creates the appropriate IRepository implemenation depending on configuration settings. However, I will have to create the implementation everytime this data source class is called, which may be expensive.