I have a project in which I use WCF Data Services to expose access to certain tables in my database (db1).
now, the requirements just changed and I am required to fetch data that used to be from database db1, table teacher from a new database db2, table teacher2, but to keep everything else same.
I am thinking of doing the following :
1- set up the .edmx file of the service to point to a stored procedure (SQL CLR), instead of pointing to table teacher.
2- in SQL CLR, initiate the connection using proprietary API and connect to database db2, and retrieve data from there.
3- send the data retrieved from db2 back to the WCF Data Services client.
Is this possible ? If so, How to do it ? Is there a better way to achieve the same ?
You can have more than one edmx per project, and more than one wcf data service. I would make a second one.