Backwards then Forwards then...?

2 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 15 Jun 2010 Link to this post

    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?
  2. Zoran
    Zoran avatar
    534 posts

    Posted 18 Jun 2010 Link to this post

    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:

    The backendconfiguration should look similar to the following:
          <backendconfiguration id="mssqlConfiguration" backend="mssql">

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

    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. DevCraft banner
Back to Top