我应该如何存储/保存我的iCollection< class< t>>在EF中

发布于 2025-02-10 04:21:21 字数 648 浏览 3 评论 0原文

我正在创建一个CMS,我选择以潜在有争议的方式保存页面。我有几个称为“页面”,“标题”,“身体”,“页脚”,“页脚”的课程; t>,row:sevments<行>,模板:段<模板>,elements< t>,段落:Elements≪段落>。

我不知道我应该如何保存类段< t>,row:sevments<行>,模板:段<模板>元素也是如此。

细分市场< t>放置在标题,车身,页脚和模板类中。 请记住,这些不是数据库对象,而是针对前端的对象,因此我可以正确渲染页面。

我应该保存细分市场< t>作为2个单独的Icollections,例如

public virtual ICollection<Row> {get; set;}
public virtual ICollection<Template> {get; set;} 

(如果可能的话),

public virtual ICollection<Segments<T>>

则有一种拟合和效率的方法来保存Icollection&lt; segments&lt; t&gt;&gt;在EF数据库中?

I'm creating a CMS in which I have chosen to save my pages in a potentially controversial way. I Have a few classes called "Page", "Header", "Body", "Footer", Segments< T >, Row : Segments< Row >, Template : Segments< Template >, Elements< T >, Paragraph : Elements< Paragraph >.

I don't know how I should save the classes Segments< T >, Row : Segments< Row >, Template : Segments< Template > the same goes for the Elements.

The Segments< T > is placed inside the Header, Body, Footer and template class.
Please keep in mind these are not database objects but these are for the frontend so I can render the page correctly.

Should i save the Segments< T > as 2 separate ICollections like

public virtual ICollection<Row> {get; set;}
public virtual ICollection<Template> {get; set;} 

Instead of (if possible)

public virtual ICollection<Segments<T>>

Is there a fitting and efficiant way to save ICollection<segments< T >> in a EF database?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文