DataManager custom code generation template

4 posts, 0 answers
  1. Martin
    Martin avatar
    1 posts
    Member since:
    Mar 2011

    Posted 07 Mar 2011 Link to this post

    Hi,

    We are currently rebuilding our data access layer and we are considering the OpenAccess framework together with WCF Data Services layer. We need to build additional functionality on top of what is currently provided by generated DataManager class, is it possible to provide custom template for generating this type of class?

    Br,
    Martin K.
  2. A.Alexandrov
    Admin
    A.Alexandrov avatar
    25 posts

    Posted 10 Mar 2011 Link to this post

    Hello Martin,

    Of course you can customize the code generation templates with your own code. The DSW templates are located at the %PROGRAMFILES%\Telerik\OpenAccess ORM\dsw\Templates directory and are separated in subdirectories, for each data service type:
    AstoriaService
    AstoriaService2
    ATOMServices
    CollectionServices
    CondimentServices
    WCFEndPoint


    Then they are separated by Visual Studio version (2008/2010) and by Language (CSharp/VisualBasic). There are also different templates for OpenAccess Domain Models (created with the visual designer) and for models created with the "classic" approach that use an ObjectScopeProvider class.

    So for example the template for the C# DataManager code file in case you use a DomainModel in Visual Studio 2010 for Astoria2 data service type is located at %PROGRAMFILES%\Telerik\OpenAccess ORM\dsw\Templates\AstoriaService2\vs2010\CSharp\DomainModel\DataManager.t4 and the template for the C# DataManager code file in case you use an ObjectScopeProvider in Visual Studio 2010 for Astoria2 data service type is located at %PROGRAMFILES%\Telerik\OpenAccess ORM\dsw\Templates\AstoriaService2\vs2010\CSharp\DataManager.t4

    If you have any other questions or concerns, please let us know.

    All the best,
    A.Alexandrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Redeeze
    Redeeze avatar
    4 posts
    Member since:
    Sep 2011

    Posted 11 Sep 2011 Link to this post

    I am using the Telerik OpenAccess Domain Model. Where is the t4 template located that is used to generate the corresponding OpenAccessContext cs file that is generated?

    Is it:

    C:\Program Files (x86)\Telerik\OpenAccess ORM\dsw\Templates\AstoriaService2\vs2010\CSharp\DomainModel\DataManager.t4

    Thanks.
  5. Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 14 Sep 2011 Link to this post

    Hi Matthew,

    The standard template for Domain Model code generation is located at:

    <InstallDirectory>\Telerik\OpenAccess ORM\dsl2010\CodeGenerationTemplates\CSharp (for 2010)
    <InstallDirectory>\Telerik\OpenAccess ORM\dsl2008\CodeGenerationTemplates\CSharp (for 2008)

    Probably in your case it should be:

    C:\Program Files (x86)\Telerik\OpenAccess ORM\dsl2010\CodeGenerationTemplates\CSharp (for VS 2010)
    or
    C:\Program Files (x86)\Telerik\OpenAccess ORM\dsl2008\CodeGenerationTemplates\CSharp (for VS 2008)

    To clarify the templates location and avoid misunderstanding - the directories mentioned in the previous post contain templates for Data Services Wizard code generation, while the templates for generating your Domain Model (the RLINQ file, containing your persistent classes) are those mentioned above, within DSL2010 and DSL2008 folders.

    Do not hesitate to contact us if you have other questions.


    Best wishes,
    Ivailo
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

Back to Top