Sequence contains no matching element

前端 未结 5 2132
滥情空心
滥情空心 2020-11-30 00:48

I have an asp.net application in which I am using linq for data manipulation. While running, I get the exception \"Sequence contains no matching element\".

i         


        
5条回答
  •  暖寄归人
    2020-11-30 01:36

    Maybe using Where() before First() can help you, as my problem has been solved in this case.

    var documentRow = _dsACL.Documents.Where(o => o.ID == id).FirstOrDefault();
    

提交回复
热议问题