日期:2014-05-20 浏览次数:21123 次
    Public Shared Function Query(ids As List(Of Guid)) As DemoItem
        DemoTableEntities.Where(Function(x) ids.IndexOf(x.ID) >= 0).ToList()
    End Function
    Public Shared Function Query(ids As List(Of Guid)) As DemoItem
        DemoTableEntities.Where("it.ID = {0} Or it.ID = {1} Or it.ID = {2} ... ", ids.ToArray).ToList()
    End Function
    '其中 it.ID = {0} Or it.ID = {1} Or it.ID = {2} ... 这句是 ids 循环动态生成的字符串
    Public Shared Function Query(ids As List(Of Guid)) As DemoItem
        DemoTableEntities.Where("it.ID = {0}", ids(0)).ToList()
    End Function
 Public Shared Function Query(ids As List(Of Guid)) As DemoItem
        DemoTableEntities.Where(Function(x) ids.Contains(x.ID)).ToList()
    End Function