LinqDataSource Where参数 [英] LinqDataSource Where Parameter

查看:76
本文介绍了LinqDataSource Where参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在可工作的aspx页面上有以下查询:

I have the below query on my aspx page that works:

<asp:LinqDataSource ID="LinqDataSource1" runat="server" 
    ContextTypeName="InventoryDataContext" 
    EntityTypeName="" TableName="V_InventoryForDisplays" 
    Where="ConfiguredCarId == @ConfiguredCarId">
    <WhereParameters>
        <asp:Parameter DefaultValue="2827" Name="ConfiguredCarId" Type="Int32" />
    </WhereParameters>
</asp:LinqDataSource>

我需要更改Where子句以使用Contains语句.我有自动财产Ж

I need to change the Where clause to use a Contains statement. I have an auto-propertyЖ

public IEnumerable<int> ConfiguredCarIds { get; set; }

在我要使用的同一类中

那么执行此操作的正确语法是什么?

so what is the proper syntax to do this:

Where="ConfiguredCarIds.Contains (ConfiguredCarId)"

谢谢!

推荐答案

尝试 Where ="ConfiguredCarId.Contains(@ConfiguredCarId)"

这篇关于LinqDataSource Where参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆