Entity Framework 6 - Dynamic Objects

My company has 100 databases with several thousand objects, including tables, SP and views.

I create a common data layer using Entity Framework 6 for my company's special projects, so developers don’t have to worry about the underlying database.

My project contains an empty data model (.edmx).

Now, based on the user's choice, I need to establish a connection and get objects at runtime. After registering these objects, I need to provide the data set to the caller.

For example: the developer calls a method from my class and passes the name of the entity as an enumeration string .say ... "Entity.Orders"

Here .. my code knows that “Orders” refers to a database named “Sales” that is located on the “SalesBox” server.

Now my code establishes a connection to the Sales database, retrieves the rows from the Order table, creates a List collection (or any other), and returns the collection to the caller.

Is this possible using EF 6? If so, how?

+5
source share

All Articles