How to pull a data contract model from an existing database table

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
Jan 7, 2008 at 10:44 PM
Hello All,
I like the Service Software Factory that is currently available. I also like the repository factory as well. I wrote a 120 page HowTo for some of the developers I work with, about 40 in all, in how to generate the web service accessing a db backend and how to consume this service in only 10 total lines of developer created code. It has been received with some excitement. Others are questioning how this can be used in our type of enterprise.
One thing that I was curious about is, is there a way to get a skeleton "Data Contract" from an existing db table?
Developer
Jan 8, 2008 at 3:58 PM
The only way to create a DC model is manually from scratch. However, there a couple of ways to get something like you want. You may add a new recipe that create a model by getting the structure of a DB table (read the Extensibility Hands-on lab in the home page of this wiki) or simple export an XML Schema definition of your tables and reference them from the Servvice Contract model using the XsdMessage element.
Jan 8, 2008 at 7:23 PM
Charlyfriend,
Thank you for getting back to me. I figured I would most likely have to create a new guidance, but I wanted to make sure that if I did that, I was not going to do something that someone else has already done and posted to the community.
I will look into this and if anyone is interested, I could post back to the community if I get to that.


charlyfriend wrote:
The only way to create a DC model is manually from scratch. However, there a couple of ways to get something like you want. You may add a new recipe that create a model by getting the structure of a DB table (read the Extensibility Hands-on lab in the home page of this wiki) or simple export an XML Schema definition of your tables and reference them from the Servvice Contract model using the XsdMessage element.

Aug 31, 2010 at 2:34 PM

I am wondering if anybody successful in generating model from existing tables in database. I already have a huge database and now I need to expose the business layer in to service layer. I have generated the select, insert, update, and delete methods from database schema and want the same for data model. It’s no feasible to do this all manually. I have seen the xml in .datacontract file but each column is assigned a GUID not sure if I can assign my own GUID.

I simply trying to generate this .contract file by reading database schema and the I want to use .contract file to generate data contract classes. I believe it’s a common need the most of people are willing to solve and if any one solved please share it here.

Thanks,

Aug 31, 2010 at 2:43 PM

hasanboby,

I never got around to doing this, got busy with other stuff.  Sorry.