How to persist a complex type in forward mapping

Thread is closed for posting
2 posts, 0 answers
  1. Tim
    Tim avatar
    7 posts
    Member since:
    Oct 2012

    Posted 17 Aug 2011 Link to this post


    I have a set of classes already and I am trying to map them to database.
    However, some of my properties are complex types such as custom class, structure.
    How can I persist those properties using complex types?

    Here are sample codes similar to my classes.
    I need to persist Book class to database.
    How do I configure the MainAuthor, CoAuthor and Index properties (in forward mapping wizard or other ways)?


    Public Class Book
        Public Property Title As String
        Public Property PublishDate As Date
        Public Property Publisher As String
        Public Property ISBN As String
        Public Property MainAuthor As Author
        Public Property CoAuthor As Author
        Public Property Index As BookIndexCode
    End Class
    Public Class Author
        Public Property FirstName As String
        Public Property LastName As String
        Public Property Expertise As String
    End Class
    Public Structure BookIndexCode
        Dim Category As Integer
        Dim Subcategory As Integer
        Dim Segment As Integer
        Dim SerialNumber As Integer
    End Structure
  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 18 Aug 2011 Link to this post

    Hi Tim,

    I recommend you reading this help article which demonstrates how to achieve that goal.
    Hope that helps. If any other questions arise, do not hesitate to contact us back.

    Best wishes,
    Damyan Bogoev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top