Entity Framework 4: Selecting Single Record

后端 未结 3 2048
孤城傲影
孤城傲影 2020-12-06 00:10

I\'m currently planning on switching my \"manual query-writing\" code to a nice SQL framework, so I can leave the queries or sql things to the framework, instead of writing

3条回答
  •  一个人的身影
    2020-12-06 00:59

    You can use Single or First methods.

    The difference between those methods is that Single expects a single row and throws an exception if it doesn't have a single row.

    The usage is the same for both of them

提交回复
热议问题