I am glad that I have helped you.
I also would like to take the issue a bit further and show you how you can use OpenAccess
data model designer as database design tool. There are several steps that have to be taken, but I think this will be enable you to solve your future tasks easier.
- Enable extensibility of the generated FluentMetadataSource class:
- Locate the FluentMapping.ttinclude code generation template. It is located under <OpenAccess Install Dir>\dsl2010\CodeGenerationTemplates\CSharp\Includes\ (by default the path is: C:\Program Files\Telerik\OpenAccess ORM\dsl2010\CodeGenerationTemplates\CSharp\Includes\). If you are using Visual Basic please substitute CSharp with VisualBasic.
- Edit line 30 in the template. Add the "partial" keyword to the class definition line, save and close the template:
<#= metadataSourceName #> : <#= FluentMetadataSourceToken #>
- Add new Domain Model
- Add a new Domain Model to your project. Select empty model on the first page.
- Go to Code Generation Settings page in the wizard and select Fluent in the Mapping Type. Finish the wizard.
- Add a new class to the same project in order to extend the generated <Your Model Name>FluentMetadataSource class.
- Add the following code in the newly created class:
MetadataContainer container =
container.NameGenerator.SourceStrategy = NamingSourceStrategy.Property;
MetaForeignKeyAssociation fkAssociation = association
MetaJoinTableAssociation joinTableAssociation = association
var constrainsToRemove = joinTableAssociation.JoinTable.Constraints.Where(c => c.Name ==
- Create a database schema update development-only application - see the attached sample application.
- Use the database schema update application to push the changes in the domain model to the database and/or create database schema scripts.
So far this is the best way to enable the scenario that you would like to execute.
The only drawback that I would like to point out is the requirement to use an external application to push changes to the database schema instead of using the context menu Update Database from Model in the RLINQ designer. This step is required because of a limitation in the implementation of the designer.
This issue will be addressed in the future releases of OpenAccess
If you have any questions or you need further clarifications of the described approach, do not hesitate to get back to us.
All the best,
the Telerik team
Want to use Telerik OpenAccess with SQL Azure? Download
the trial version today.