Hello,
I'm trying to make an application in which both the developer and the end user are allowed retrieve data from a relational DB (chosen at runtime) without writing any SQL code at all (and preferably no string concatenations when interacting with the database). The purpose of the application is to two things: a GUI to an expression tree builder and XML serialization of trees generated by it.
I'd like to ask for some guidance or tips as to how to get things rolling. I don't want someone else to write this for me - this is my project I'll be the one writing the code.
So my questions are:
Is it possible by only using only a connection string at run time to be able to create the object model and address the DB's elements in sets - for example a list of all of the tables, views, functions and sprocs?
Can the elements of the aforementioned lists be used in the extension methods so I can build an expression tree?
Can I use the Metadata Workspace class and the ItemCollections in order to retrieve those lists from the database having only the CSDL, SSDL and MDL files (but no Entity classes)?
Can I use LINQ to XML in order to serialize the results of the expression tree or I will have to use some other serialization technology, specific to the Entity Framework? (Like in the example shown here: http://msdn.microsoft.com/en-us/library/bb738528.aspx)
PS: Here are some notes from my research so far: 1. For example the DataContext.GetTable() method (yes, the weakly typed one, not the generic) did not retrieve any data when the DataContext received only a connection string.
I'm calling the EdmGen tool in order to generate the schema artifacts and so far I've read their attributes but I'm still trying to get some sort of list of elements which can be used in a lambda expression (tables for example)?
If I understood correctly, in the Entity Framework I can use classes such as the Metadata Workspace and ItemCollections along with the EdmGen tool in order to create the necessary set of objects with which to represent the conceptual schema as an object model in the application.
I've browsed the Entity Framework Programming guide along the other related topics both here and on MSDN but so far I haven't found any information that is relevant to this scenario. Yesterday I got the "Programming Entity Framework" book and I hope that some of the answers lie in it. I'll update this question if I find any clues.
So, confused and still searching, I thank you in advance for any help on the matter.
Best regards, Borislav