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

RadPropertyGRid dataannotations and OpenAccessORM

1 Answer 40 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Craig
Top achievements
Rank 1
Craig asked on 23 Jan 2013, 04:27 PM
Hi
I'm using OpenAccessORM and RadPropertyGrid.
I saw in the RadPropertyGrid demo the use of DataAnnotations. I'd like to make use of them and I would like to define them once in my OpenAccessORM project.
How do I do it?
Regards
Craig

1 Answer, 1 is accepted

Sort by
0
Dimitar Tachev
Telerik team
answered on 25 Jan 2013, 04:35 PM
Hello Craig,

If your application is using the Code First approach you could easily set the DataAnnotation attributes directly on the properties of your entities.

Otherwise in order to use the DataAnnotations with the Telerik OpenAccess ORM we are offering a custom code generation template which is generating buddy classes for your entities. Also this template is automatically generating the Key, Required and StringLength attributes for your properties based on the metadata from your database. 

After creating these classes you could easily delete the code generation template, add any other needed attributes for the properties and use these buddy classes in your application.

You could find more information about this template and how to use it in this Code Library example.

I hope this helps. Do not hesitate to contact us back if you need any further assistance.

Kind regards,
Dimitar Tachev
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Tags
Integration with other products
Asked by
Craig
Top achievements
Rank 1
Answers by
Dimitar Tachev
Telerik team
Share this question
or