yuan8825399 / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

Mapping data returned from sp to custom object #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Ex:
- My stored procedure:
   SELECT UserId, Username
   FROM tblUsers

- And my DTO class:
public class Customer {
 public int Id {get;set;}
 public string Nickname {get;set;}

}

How can I use Dapper to get data from the stored procedure and map to customer 
objects without using alias (UserId as Id, and Username as Nickname)

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by quangle...@gmail.com on 8 Jan 2012 at 2:04