我通过存储过程使用
Dapper进行一些只读数据库调用.我有一个查询将返回1行或没有.
我正在使用这样的Dapper:
返回的CaSEOfficer对象如下所示:
- public class CaSEOfficer
- {
- public string Title { get; set; }
- public string FirstName { get; set; }
- public string LastName { get; set; }
- public string Email { get; set; }
- public string Telephone { get; set; }
- }
然后通过ASP.NET Web API应用程序将其作为JSON返回.
当存储过程返回结果时,我得到以下内容:
- {
- title: "Mr",firstName: "Case",lastName: "Officer",email: "test@example.com",telephone: "01234 567890"
- }
但当它返回什么我得到:
- {
- title: null,firstName: null,lastName: null,email: null,telephone: null
- }