How to map value types?

2 posts, 0 answers
  1. Joseph Lam
    Joseph Lam avatar
    10 posts
    Member since:
    Jan 2010

    Posted 22 Jul 2014 Link to this post

    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
  2. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 28 Jul 2014 Link to this post

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