2017-02-20 54 views
0
Dim payorProvidersList = (From pp In payorProviders 
           Group Join p In accPayors On p.PayorCode Equals pp.PayorCode Into gpPP = Group From p In gpPP.DefaultIfEmpty() 
           Group Join hpc In hipaaPayorConnectors On hpc.ConnectorId Equals pp.ConnectorID And hpc.PayorCode Equals pp.PayorCode And hpc.TransactionType Equals pp.TransactionType Into gpHPC = Group From hpc In gpHPC.DefaultIfEmpty() 
           Select New PayorProvidersInfo With 
            { 
             .ID = pp.ID, 
             .PayorCode = pp.PayorCode, 
             .ProviderId = pp.ProviderId, 
             .CreatedBy = pp.CreatedBy, 
             .CreatedDate = pp.CreatedDate, 
             .UpdatedBy = pp.UpdatedBy, 
             .UpdatedDate = pp.UpdatedDate, 
             .ConnectorID = pp.ConnectorID, 
             .NPI = pp.NPI, 
             .Order = hpc.Order, 
             .TransactionType = pp.TransactionType, 
             .PayorName = If(p IsNot Nothing AndAlso p.PayorName IsNot Nothing, p.PayorName, "Unknown"), 
             .EmdeonPayorName = If(p IsNot Nothing AndAlso p.EmdeonPayorName IsNot Nothing, p.EmdeonPayorName, "Unknown")}).ToList() 
+2

更換hpc.ConnectorId你應該告訴我們這行是造成異常。 – DarkKnight

+0

順便說一下,它是VB.net,而不是c#。 – DarkKnight

+0

第3行。'hpc.ConnectorId'引發了'System.NullReferenceException'類型的錯誤。 – sujeet

回答

0

hpc.ConnectorId替換爲If(hpc.ConnectorId, 0)

編輯:

根據您的意見,您的問題是不是與整場,但hpc對象本身。

嘗試If(hpc is nothing, 0,hpc.ConnectorId)

+0

試過這個,但但得到complie時間錯誤,所以用這個If(CType(hpc.ConnectorId,Integer?),0)。但是再次出現同樣的錯誤。 – sujeet

+0

@sujeet錯誤是什麼? – DarkKnight

+0

System.NullReferenceException {「對象引用未設置爲對象的實例。」} – sujeet