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

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

2 Answers 30 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Skywalker
Top achievements
Rank 1
Skywalker asked on 06 Sep 2010, 04:44 PM
Hi,

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?

Greets,
Skywalker

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander
Telerik team
answered on 08 Sep 2010, 04:53 PM
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.

Greetings,
Alexander
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
0
Skywalker
Top achievements
Rank 1
answered on 09 Sep 2010, 12:44 AM
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!

Cheers,
Skywalker
Tags
Design Time (Visual Designer & Tools)
Asked by
Skywalker
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Skywalker
Top achievements
Rank 1
Share this question
or