如何使这些模型与Entity Framework一起使用?

时间:2016-12-31 22:55:15

标签: c# .net entity-framework model

很久以前,我开始研究一个简单的项目来学习更多关于ASP.NET的知识。稍后我决定使用数据库进行存储而不是序列化,因此我稍微更新了现有模型,尝试使它们首先使用Entity Framework。不幸的是,似乎这些类太复杂而无法转换为数据库表。

Here are the models

以此部分为例:

// Profile.cs
...
public virtual List<Profile> Friends { get; set; }
public virtual List<Community> Subscriptions { get; set; }
public virtual List<Community> Owned { get; set; }

我不认为这会像它应该的那样起作用,由另一个实体引用的同一类型的多个实体集合在没有类似层次结构的情况下变得混乱数据。

如何让这些模特更加符合EF?

0 个答案:

没有答案