问题
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>
I need to change the Where clause to use a Contains statement. I have an auto-propertyЖ
public IEnumerable<int> ConfiguredCarIds { get; set; }
within the same class that I would like to use
so what is the proper syntax to do this:
Where="ConfiguredCarIds.Contains (ConfiguredCarId)"
Thanks!
回答1:
Try Where="ConfiguredCarId.Contains(@ConfiguredCarId)"
来源:https://stackoverflow.com/questions/6894654/linqdatasource-where-parameter