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

[Solved] Reverse Mapping Views with Q2 Release

3 Answers 115 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew
Top achievements
Rank 1
Andrew asked on 15 Sep 2010, 07:15 PM
Hi,

I'm trying get primary keys defined for a view so I can use it in a domain service.  The only way I've found to do this is through reverse mapping, but all the references for it use the Reverse Mapping Wizard instead of the new Visual Designer.  

How can I set primary keys on my views to use them in my domain service?

Thanks,
Andrew

3 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 16 Sep 2010, 03:19 PM
Hello Andrew,

You can define primary keys for a view by doing the following steps:
1.   Select the generated class from the Visual Designer;
2.   Click on the class’ property which should be set as primary key;
3.   Set its Identity property from the Properties pane of Visual Studio to True and save the diagram;
Hope that helps.

Greetings,
Damyan Bogoev
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
Sumith Jayasuriya
Top achievements
Rank 1
answered on 29 Dec 2010, 09:35 PM
I converted to Domain Model and would like to set up a primary key for a view in the model using multiple fields.  The view is combining data from two tables and the Primary Key of the view is the combination of key of Table 1 (Identity) and key of Table 2 (Identity).  
0
Serge
Telerik team
answered on 30 Dec 2010, 03:30 PM
Hello Andrew,

 As the primary key that you will define will only be used by OpenAccess it will not reflect upon your database schema. Marking the properties as identities using the designer as Damyan has suggestion should be the only thing you need to do in order to achieve your goal. 

I hope this is helpful.

Kind regards,
Serge
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Sumith Jayasuriya
Top achievements
Rank 1
Serge
Telerik team
Share this question
or