Однонаправленные отношения один-к-одному в Entity Framework

Ниже приведен пример отношения «один к одному», создающего исключение.

<code>public class User
{
    public int Id { get; set; }
    public Address Address { get; set; }
}

public class Address
{
    public int Id { get; set; }
    public User User { get; set; }
}
</code>

Исключение говорит:

Unable to determine the principal end of an association between the types 'ConsoleApplication1.Address' and 'ConsoleApplication1.User'. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.

это работает, если я удаляю свойство пользователя из адреса, но я не хочу.

Как я могу иметь такие отношения без исключения?

Ответы на вопрос(2)

Ваш ответ на вопрос