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
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.
A.Alexandrov
the Telerik team
Is it:
C:\Program Files (x86)\Telerik\OpenAccess ORM\dsw\Templates\AstoriaService2\vs2010\CSharp\DomainModel\DataManager.t4
Thanks.
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 >>