Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 16, 2012 10:29 AM by Steven Cheng - MSFT
May 09, 2012 11:04 PM|LINK
I know you can essentially wrap a WCF Data Service around an EntityFramework DbContext in an MVC project, but what about creating a DbContext and its DbSets from a WCF Data Service. As I see it now, you would have to manually create the DbContext from the
WCF Data Service Client context object and then also manually set up each DbSet?
I'm wondering if there is quicker way of implementing such a thing. The use case would be I have an MVC 3 project where I want to set up my models from a WCF Data Service and have them accessible in the same way an Entity Framework EDM would be accessible
if I created one via database-first or model-first.
May 10, 2012 02:12 AM|LINK
I haven't tried created DbContext and it's DbSet from WCF Data Service. But I have done from Database create .edmx file using "ADO.NET Entity Data Model" with these steps:
May 10, 2012 02:54 PM|LINK
Yes, I know how to create a model from a database in a database-first scenario, but what I really want is to be able to build an MVC site to consume data from a WCF Data Service WITHOUT a database. I can do this, but I basically need to implement the ObjectContext
manually. I am looking for a tool that will read the WCF Data Service (like a OData Visualizer) and generate an Entity Data Model or DbContext/DbSets for me.
May 16, 2012 10:29 AM|LINK
As far as I know, there seems no built-in tool which can generate DbContext data model class from given WCF Data Service(or the metadata document for the OData service).
As the WCF Data Service 5.0 feature indicate, it start supporting code-first design by directly use a DbContext derived class as data source of OData service. However, we still need to implement the DbContext derived class (and populate the entity sets by
implementing the DbSet<T> properties.
#What's New in WCF Data Services 5.0