SqlException because Subquery returned more than 1 value

前端 未结 2 1022
眼角桃花
眼角桃花 2021-01-28 02:10

I have the following LINQ query that I am using to construct a structure to stuff into a JavaScript grid library which is irrelevant for this example, but I figured I would stil

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-28 02:15

    The SingleOrDefault call will throw an exception if the expression returns more than one item. Maybe you could try and use FirstOrDefault if its just the Top 1 you want.

提交回复
热议问题