【问题标题】:With the EntityDataSource, where does the "it" come from?使用 EntityDataSource,“它”从何而来?
【发布时间】:2013-12-04 15:03:20
【问题描述】:

所以,我正在使用ASP.NETEntity Framework 6 使用WebForms 做一些工作。

我设置了一个绑定到 EntityDataSource 的简单 GridView。我还设置了一个小文本框来过滤我的结果集。

效果很好。我已经从在线教程中提取了这个例子,但我似乎没有得到Where 子句的it 部分来自哪里?对我来说,它看起来像是纯 LINQ(我有一些经验)。

这是我的 EntityDataSource 的示例:

<asp:EntityDataSource
    ID="TrailerDataSource"
    runat="server"
    ConnectionString="name=DBContext"
    DefaultContainerName="DBContext"
    EnableFlattening="False"
    EntitySetName="Trailers"
    EntityTypeFilter="Trailer"
    EnableInsert="True"
    EnableUpdate="True"
    Where="it.TrailerNumber LIKE '%' + @TrailerNumber + '%'">
        <WhereParameters>
            <asp:ControlParameter
                ControlID="tbTrailerNumberFilter"
                DbType="String"
                DefaultValue="%"
                Name="TrailerNumber"
                PropertyName="Text" />
        </WhereParameters>
    </asp:EntityDataSource>

我知道这是一个愚蠢的问题,但请尝试在谷歌上搜索“它”。

谢谢。

【问题讨论】:

    标签: asp.net .net entity-framework gridview webforms


    【解决方案1】:

    “it”元素是当前的“item”,来自Dynamic Linq

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-02
      相关资源
      最近更新 更多