This is a migrated thread and some comments may be shown as answers.

DataManager custom code generation template

3 Answers 162 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Martin
Top achievements
Rank 1
Martin asked on 07 Mar 2011, 10:15 AM
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.

3 Answers, 1 is accepted

Sort by
0
A.Alexandrov
Telerik team
answered on 10 Mar 2011, 11:12 AM
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!
0
Redeeze
Top achievements
Rank 1
answered on 11 Sep 2011, 11:33 PM
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.
0
Ivailo
Telerik team
answered on 14 Sep 2011, 12:59 PM
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 >>

Tags
Web Services
Asked by
Martin
Top achievements
Rank 1
Answers by
A.Alexandrov
Telerik team
Redeeze
Top achievements
Rank 1
Ivailo
Telerik team
Share this question
or