How to map table columns to user defined struct using the designer?

Thread is closed for posting
3 posts, 1 answers
  1. Skywalker
    Skywalker avatar
    67 posts
    Member since:
    Sep 2007

    Posted 06 Sep 2010 Link to this post


    Is it possible to map multiple columns of a table to a user defined struct?
    For example, I have a table named "Users" with the columns "FirstName, LastName, LastNamePrefix".
    In my domain model, I have a struct called "PersonName", which looks like this:

    struct PersonName
       public string FirstName;
       public string LastName;
       public string LastNamePrefix;

    Using the "classic" OpenAccess, model first approach, I could apply the Persistent attribute to this struct, define a User class and create a property of type PersonName. Then I would simply generate the database.

    My question is, how to do this the other way around using the Designer approach?

  2. Answer
    Alexander avatar
    727 posts

    Posted 08 Sep 2010 Link to this post

    Hello Skywalker,

    I am afraid this is not possible at the moment, but is on our list. Our plans are to provide support for interfaces and abstract classes in Q3, most probably structures will be covered afterwards.
    Please excuse us for the inconvenience caused.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Skywalker
    Skywalker avatar
    67 posts
    Member since:
    Sep 2007

    Posted 08 Sep 2010 Link to this post

    Hi Alexander,

    That's ok, I can write a property of the struct type in a partial class which reads its fields from the properties, which I will mark as private (well, that is when that feature is enabled of course :)).
    It's not exactly the same as using a struct directly as the backing type, but it will do just fine for now.

    Keep up the great work!

Back to Top