Flatten object to table

Thread is closed for posting
1 posts, 0 answers
  1. Thomas
    Thomas avatar
    1 posts
    Member since:
    Jan 2017

    Posted 21 Jan 2017 Link to this post

    Hello, 

    I have just begun working with the Telerik Open Data Access framework on top of an SQLite database. So far I am very impressed, and although there is some work involved in setting up the mapping and context, it is still fairly simple and straightforward compared to doing it by hand, so to speak. 

    However, I have a question regarding mapping, specifically, if it is possible to flatten a class hierarchy before mapping it to a table. E.g. something like this:

    01.public class SomeClass
    02.{
    03.        public int Id { get; set; }
    04.        public string Number { get; set; }
    05.        public string Name { get; set; }
    06.        public Information Information { get; set; }  
    07.}
    08.
    09.public class Information
    10.{
    11.        public bool Active { get; set; }
    12.        public DateTime Created { get; set; }
    13.        public string UpdatedBy { get; set; }
    14.}

     

    Should result in this table definition: 

    01.create table SomeClass
    02.(
    03.    Id        int,
    04.    Number    varchar(20),
    05.    Name             varchar(255),
    06.    Active    bit,
    07.    Created   datetime,
    08.    UpdatedBy varchar(255)
    09.)

     

    Is this possible?

     

     

     

Back to Top