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

Creating custom entities?

1 Answer 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrey
Top achievements
Rank 1
Andrey asked on 22 Mar 2012, 06:19 PM
Hi Telerik!
 Look I have the following question regarding your OpenAccess orm. Is it possible with your product to define a custom entity which takes half of its properties from one table, the other half from a second table and also a few additional logical properties (for example such one that allows manipulation on the previously-taken properties)? 

1 Answer, 1 is accepted

Sort by
0
Accepted
Zoran
Telerik team
answered on 27 Mar 2012, 03:39 PM
Hi Andrey,

 Yes it is possible to handle such scenario with OpenAccess. The approach you should take though is to create a database VIEW which joins the columns from the different table that you want to present. You can map the view then to an entity as you would map a regular table. You can additionally create a partial class to the one generated by OpenAccess and add some properties that you can calculate out of the existing ones.

All the best,
Zoran
the Telerik team
Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Tags
General Discussions
Asked by
Andrey
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or