Я пытаюсь создать взаимно-однозначное отношение между двумя таблицами, но в результате у меня есть одно-ко-многим.В чем проблема с этим кодом?
namespace EFCF_Demo.Models
{
public class Post
{
[Key]
public int ID { get; set; }
public string Title { get; set; }
public string MiniContent { get; set; }
public string Author { get; set; }
public DateTime PublishDate { get; set; }
public int Rating { get; set; }
public virtual Content MainContent { get; set; }
}
public class Content
{
public int ID { get; set; }
public virtual Post Post { get; set; }
public string FullContent { get; set; }
}
public class PostEntities : DbContext
{
public DbSet<Post> Posts { get; set; }
public DbSet<Content> Contents { get; set; }
}
}