locked
Extending the edmx schema generator RRS feed

  • Question

  • Is it possible to extend the current edmx schema generator (schema generator - .edmx file, not the code generator)? And somehow hook it as default in the Visual Studio? For example, so that when the entity model is being created, the custom extension is being run (that may of course make use of default generator)
    Friday, August 28, 2009 12:50 AM

Answers

  • Hi ef12,

     

    Welcome to MSDN Forums!

     

    The recommended practice for creating an .edmx file is to use the Entity Data Model Wizard.  I think it is not suggested modify the original Visual Studio ADO.NET Entity Data Model template and Entity Data Model Wizard logic to add some extension to the .edmx generating process.  My recommendation would be to create a new template and use the new EdmGen2.exe tool to create .edmx. and then call the code generator to create EDM codes.  The source codes of EdmGen2.exe can be found here, http://code.msdn.microsoft.com/EdmGen2.  It is an upgraded version of the EdmGen.exe which is shipped with .NET Framework 3.5 SP1.  

     

    Another option is to create some Visual Studio Add-Ins to customize the .dbml generated by Visual Studio.  For Visual Studio Extensibility issues, you can get more help from Visual Studio Extensibility forum, http://social.msdn.microsoft.com/Forums/en-US/vsx/threads.  

     

     

    Have a nice weekend!

     

     

    Best Regards,
    Lingzhi Sun


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 28, 2009 7:01 AM
  • While this is not possible in VS2008, in VS2010 we have added MEF extension points that allow you to plug in custom behavior after model creation and after model update.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, August 31, 2009 6:15 PM

All replies

  • Hi ef12,

     

    Welcome to MSDN Forums!

     

    The recommended practice for creating an .edmx file is to use the Entity Data Model Wizard.  I think it is not suggested modify the original Visual Studio ADO.NET Entity Data Model template and Entity Data Model Wizard logic to add some extension to the .edmx generating process.  My recommendation would be to create a new template and use the new EdmGen2.exe tool to create .edmx. and then call the code generator to create EDM codes.  The source codes of EdmGen2.exe can be found here, http://code.msdn.microsoft.com/EdmGen2.  It is an upgraded version of the EdmGen.exe which is shipped with .NET Framework 3.5 SP1.  

     

    Another option is to create some Visual Studio Add-Ins to customize the .dbml generated by Visual Studio.  For Visual Studio Extensibility issues, you can get more help from Visual Studio Extensibility forum, http://social.msdn.microsoft.com/Forums/en-US/vsx/threads.  

     

     

    Have a nice weekend!

     

     

    Best Regards,
    Lingzhi Sun


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 28, 2009 7:01 AM
  • While this is not possible in VS2008, in VS2010 we have added MEF extension points that allow you to plug in custom behavior after model creation and after model update.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, August 31, 2009 6:15 PM
  • Hi elf12,

     

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions? 

     

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

     

    Have a nice weekend!

     

     

    Best Regards,
    Lingzhi Sun


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, September 4, 2009 8:01 AM