One-to-One Relationships in Sql Server and LINQ

I have a Users table and a profile table. The reason they are separate is because user information can be entered before they are registered for the site. The problem I am facing is that when I establish relationships on Sql Server, it wants to create relationships from one to many. I see no way to change this.

+4
source share
1 answer

I assume that you create it using ASP.NET membership? If so, just add a uniqueidentifier column inside your profile table, set it as the primary key, and you'll be fine. SQL will not allow you to add more than 1 records for this identifier.

In this article you will find what you need http://www.asp.net/security/tutorials/storing-additional-user-information-cs

+2
source

Source: https://habr.com/ru/post/1314654/


All Articles