获取列表的前N个孩子的元素,例如四个要素。
我试过这样的事:
<div id="top_min_order_alert">
<p>Minimum Order: $5 for carry out orders, $10 for delivery (before tax and delivery fee)</p>
<p>Online ordering stops 15 minutes before closing time</p>
<p><a href="#" onclick="toggle_visibility('top_min_order_alert');">Ok, Got it.</a>
</p>
</div>
但它没有用。
当我尝试这样的代码时,我也会收到错误:
_context.Blogs.Where(x => x.IsActive).Include(x => x.Posts.Take(4));
属性表达式&#39; x =&gt; {[x] .Posts =&gt;取(4)}&#39;无效。 表达式应代表属性访问权限:&#39; t =&gt; t.MyProperty&#39;