This is a migrated thread and some comments may be shown as answers.
ORM Free Edition with MVCScaffolding
1 Answer 64 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ajay
Top achievements
Rank 1
Ajay asked on 20 Jun 2011, 06:23 PM
I am trying to use Telerik OpenAccess ORM Free edition with MVCScaffolding (http://mvcscaffolding.codeplex.com/).
When  I use this tool with Linq2SQL for generating scaffolding (Controller, CRUD functions and respective Views), it generates correctly.
When  I use the same with OA context entities, it is unable to locate any primary key. 
The tool looks for primary key in the code generated by OA ORM (or Linq2SQL) and it does not find when the code the generated by Telerik OA ORM.
Is there a way to force OA ORM to insert primary key in the generated code?
e.g
[global::System.Data.Linq.Mapping.ColumnAttribute(Name="ConsumerID", Storage="_ConsumerID", DbType="NVarChar(30) NOT NULL", CanBeNull=false, IsPrimaryKey=true, UpdateCheck=UpdateCheck.Never)]

There are no decorations on code generated by OA, as such no way for scaffolder to know column attributes?
Do you recommend any specific scaffolding tool?



1 Answer, 1 is accepted

Sort by
0
Dimitar Kapitanov
Telerik team
answered on 21 Jun 2011, 07:23 AM
Hello Ajay,
We support three types of mapping - XML, Attributes-based (that is where you get the decorated entities) and Fluent API. In order to have the attributes you need to change the mapping to attributes-based (Designer->context menu> Model Settings.. >Mapping type combo), however I am not sure that will work for you because of the following two reasons:
- We don't decorate (yet) our entities with the Data.Annotations attributes (which MVC understands and knows how to deal with)
- probably the scaffolding has a part that 'understands'  L2S and EF (both frameworks from MS) and is not implemented for third-party vendors like Telerik. Definitely it will need some glue code that we have to write in order to support the scaffolding framework. I cannot promise you we will be able to deliver that for Q2, but definitely we are looking into that direction and we will schedule development there.

Best wishes,
Dimitar Kapitanov
the Telerik team
Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
Tags
Data Access Free Edition
Asked by
Ajay
Top achievements
Rank 1
Answers by
Dimitar Kapitanov
Telerik team
Share this question
or