Linq声明在vb

时间:2014-05-09 16:05:52

标签: vb.net entity-framework

我是新手vb而不是新手但多年来使用过chsarp我无法弄清楚这句话有什么不对。调试器甚至没有到达返回列表部分,所以我不知道是什么。我使用相同的上下文来添加文件,所以我不认为它是我声明它的方式

Private threeSoftwareContext As New R3DeliveryEntities1


Public Function GetAlLFilesToBeProcessedByLocation(location As Int32, status As StatusTypes) As List(Of downloadedFile)

    Dim list As New List(Of downloadedFile)
    list = (From files In threeSoftwareContext.downloadedFiles Where files.location = 0 And files.status = status).ToList()
    Return list
End Function

异常消息enter image description here

我得到了它的工作,但我在vb中没有的是我如何给它列名称

 Dim retVal As List(Of downloadedFile)
    Try
        retVal = (From files In threeSoftwareContext.downloadedFiles Where  files.location = 0).ToList()


        Return retVal
    Catch ex As Exception
        MsgBox(ex.ToString())
    End Try

    Return retVal

0 个答案:

没有答案