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

Backwards then Forwards then...?

1 Answer 37 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 16 Jun 2010, 12:28 AM
I have an object model that I want to persist, but I also want to use the ASP.NET membership functionality and I want to create a relationship between one of my objects and the aspnet_Users table created for the Membership code.

What I've done so far is:
  1. Backwards map the aspnet_Users table.
  2. Modified the relevant object in my model to include aspnet_User as a property
  3. Forwards map my object model to add the needed tables to the DB.

What I need to do now is create a relationship between one of my object and the aspnet_Users table. The thing is I'm unsure of what the next step should be.

Anyone have any ideas?

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 18 Jun 2010, 08:50 AM
Hello Stuart Hemming,

 By adding a reference from your own persistent class to the class that is reverse mapped from the aspnet_Users table, the forward mapping mechanism of OpenAccess has already created a connection between the table of your class and the aspnet_Users table. The relation might not be exposed as a foreign key constraint as OpenAccess does not create FK constraints by default. However the OpenAccess runtime will handle objects in both tables as expected. If you want to create a foreign key constraint between the two tables, you should set the following option in the backendconfiguration section of your app.config file:

<dbNullForeignKey>true</dbNullForeignKey>
The backendconfiguration should look similar to the following:
<backendconfigurations>
      <backendconfiguration id="mssqlConfiguration" backend="mssql">
        <dbNullForeignKey>true</dbNullForeignKey>
        <mappingname>mssqlMapping</mappingname>
      </backendconfiguration>
</backendconfigurations>

I hope this clarifies the situation in question for you. If you have any further questions please do not hesitate to contact us back.


Regards,
Zoran
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
Tags
Getting Started
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Zoran
Telerik team
Share this question
or