ORM Free Edition with MVCScaffolding

2 posts, 0 answers
  1. Ajay
    Ajay avatar
    10 posts
    Member since:
    Apr 2011

    Posted 20 Jun 2011 Link to this post

    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?
    [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?

  2. Dimitar Kapitanov
    Dimitar Kapitanov avatar
    632 posts

    Posted 21 Jun 2011 Link to this post

    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. 
  3. DevCraft banner
Back to Top