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

How to map value types?

1 Answer 25 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joseph Lam
Top achievements
Rank 1
Joseph Lam asked on 22 Jul 2014, 02:54 PM
I have some custom value types that I need to map into columns of the parent entity's table (by some custom codes) instead of separate tables with foreign keys. Value type objects don't have identities. Is this supported? I can't find any mentioning of value types in the online documentation.

Joseph

1 Answer, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 28 Jul 2014, 08:19 AM
Hello Joseph,

As far as I understand, the concept you need to utilize is close to the one described in this Stackoverflow thread. If this is indeed the case, with Telerik Data Access you can achieve a similar outcome with specifying custom converters for the columns of the parent entity. In general, the custom converter needs to implement a logic that translates a SQL type to a CLR type and vice versa. You can find an example and details in this blog post. The implementation of the Varchar2IntConverter converter provided in the article can be found here.

If my assumption does not match your scenario, or if you have additional questions, do not hesitate to get back to us.



Regards,
Doroteya
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Getting Started
Asked by
Joseph Lam
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Share this question
or