I created the following model in Designer Model 5 Designer in Visual Studio 2012:

Then I generated the database from the model, which resulted in the following tables in my database:

Please help me understand why the Entity Framework generates a one-to-many relationship for a one-to-zero-one association.
Update # 1
Also, if I change the association from 1: 0..1 to 1: 1 as follows:

Then the database not only does not have a one-to-one relationship, but now the one-to-many relationship is upside down, which seems even stranger to me:

Update # 2
Mystere Man , SQL Server, 1: 0..1, :

, , , :
public class UserMap : EntityTypeConfiguration<User>
{
public UserMap()
{
ToTable("Users");
HasKey(t => t.UserId);
Property(t => t.UserId)
.HasColumnName("UserId");
Property(t => t.Name)
.HasColumnName("Name")
.IsRequired()
.HasMaxLength(50);
Property(t => t.EmailAddress)
.HasColumnName("EmailAddress")
.IsRequired()
.HasMaxLength(254);
Property(t => t.CreatedDateTime)
.HasColumnName("CreatedDateTime");
HasOptional(t => t.Subscription)
.WithRequired(t => t.User);
}
}
public class SubscriptionMap : EntityTypeConfiguration<Subscription>
{
public SubscriptionMap()
{
ToTable("Subscriptions");
HasKey(t => t.SubscriptionId);
Property(t => t.SubscriptionId)
.HasColumnName("SubscriptionId");
Property(t => t.TypeValue)
.HasColumnName("TypeValue");
Property(t => t.CreatedDateTime)
.HasColumnName("CreatedDateTime");
Property(t => t.ExpiresDateTime)
.HasColumnName("ExpiresDateTime");
HasRequired(t => t.User)
.WithOptional(t => t.Subscription);
}
}
, , Code First Entity Framework. , Model First.
?
!