Creating the model

by Alexey Shirshov May 14, 2009 10:48

Worm has three ways to create object model

  1. Use code generator
  2. Write mapping schema for object manually
  3. Use attribute-based mapping

If you already have object model you can use POCO functionality to map the classes.

By this time Worm has no full-functional VS designer and the only way to automatically generate model is to use codegen utilitis. There is two

To generate xml from AdventureWorks run the following

Worm.CodeGen.XmlGenerator.exe -S=(local)\sqlexpress -E -D=AdventureWorks

The program produce AdventureWorks.xml (143.19 kb)

Now, you can generate code from the xml via code generator or custom tool. VS custom tool is code generator that can be used with Visual Studio. To use it you should

  1. register custom tool in VS
  2. add xml to solution
  3. assign custom tool to xml file

Here is how to register custom tool in Visual Studio

regasm /codebase <path to custom tool>\Worm.CodeGen.VSTool.dll

Now you can add xml file to solution and set Custom tool property of the AdventureWorks.xml file to WormEntityClassGenerator.

Add comment


(Will show your Gravatar icon)  

Enter the word
captcha word
(hear it spoken)


  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen | Modified by Mooglegiant

The Author

My name is Alexey Shirshov. I'm a professional developer with wide specialization. I prefer VB.NET to C#, I hate ASP.NET but there is no better than it. You can contact me by this page.