DSL and EF
Get flash to fully experience Pearltrees
Extensible Application Markup Language (XAML) Click here to download a zip file with all of the PDF files. Audience The languages documentation is intended for use in conjunction with publicly available standard specifications, computer language design and implementation art. It assumes that the reader either is familiar with this material or has access to it.
When VS 2010 ships it will include some significant improvements to our code generation story for the Entity Framework. The basic idea is to make use of T4 templates for code generation and ship strong integration into the Entity Framework Designer to make the experience of customizing those templates as seamless as possible. Below Sanjay from our Tools team outlines what will be possible once VS 2010 is released.
Visual Studio 2005 provides the IWizard interface that, when implemented, enables you to run custom code when a user creates a project from a template. Project template customization can be used to: Display custom UI that collects user input to parameterize the template. Add parameter values to use in the template. Add additional files to the template. Perform virtually any action allowed by the Visual Studio automation object model on a project.
For example, you could create a template to define an HTML page: <html><body> The date and time now is: <#= DateTime.Now #></body></html> Notice that the template resembles the generated output. The similarity of the template to the resulting output helps you avoid mistakes when you want to change it.
In previous posts, I’ve described CSDL annotations , how to extract CSDL from EDMX and introduced you to how the ADO.NET Entity Designer generates code . In this post, I’ll delve into replacing the EntityModelCodeGenerator with a SingleFileGenerator you create. Now, why would you want to do such a thing? Well, there are a number of scenarios where this is interesting and the good news is its fairly straight forward to do and there are lots of samples and documentation to help you get there.