Click here to Skip to main content
15,913,773 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Dapper Pin
UstesGreenridge29-Apr-16 3:52
UstesGreenridge29-Apr-16 3:52 
GeneralRe: Dapper Pin
stoneyowl228-Apr-16 10:57
stoneyowl228-Apr-16 10:57 
GeneralRe: Dapper Pin
Caspian Canuck29-Apr-16 3:33
Caspian Canuck29-Apr-16 3:33 
GeneralRe: Dapper Pin
pt140128-Apr-16 20:26
pt140128-Apr-16 20:26 
GeneralRe: Dapper Pin
Ste.S28-Apr-16 21:14
Ste.S28-Apr-16 21:14 
GeneralRe: Dapper Pin
Mark Jerzykowski29-Apr-16 3:14
professionalMark Jerzykowski29-Apr-16 3:14 
AnswerRe: Dapper Pin
Caspian Canuck29-Apr-16 3:32
Caspian Canuck29-Apr-16 3:32 
GeneralRe: Dapper Pin
James VT29-Apr-16 6:01
James VT29-Apr-16 6:01 
I used it for a project. I didn't use any of the object-relational mapping, but I liked that I could swap this:

SqlConnection conn = new SqlConnection(connString);
string sql = @"select * from MyTable";
SqlCommand cmd = new SqlCommand(sql, conn);
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (rdr.HasRows) 
{
   while (rdr.Read())
   {
     //do something with record
   }
   rdr.Close();
}

with this:

SqlConnection conn = new SqlConnection(connString);
string sql = @"select * from MyTable";
IEnumerable<object> flatResult = conn.Query<dynamic>(sql);


I thought that was pretty handy, especially for quick prototyping where the table and field names were changing a lot and I didn't want to hassle with altering all the field names and just wanted a quick resultset back.
GeneralRe: Dapper Pin
Slacker00729-Apr-16 7:12
professionalSlacker00729-Apr-16 7:12 
GeneralThought of the day PinPopular
OriginalGriff28-Apr-16 4:54
mveOriginalGriff28-Apr-16 4:54 
GeneralRe: Thought of the day Pin
User 842028-Apr-16 5:01
User 842028-Apr-16 5:01 
GeneralRe: Thought of the day Pin
Johnny J.28-Apr-16 5:03
professionalJohnny J.28-Apr-16 5:03 
GeneralRe: Thought of the day Pin
Cornelius Henning28-Apr-16 5:07
professionalCornelius Henning28-Apr-16 5:07 
GeneralRe: Thought of the day Pin
HobbyProggy28-Apr-16 5:39
professionalHobbyProggy28-Apr-16 5:39 
GeneralRe: Thought of the day Pin
MarcusCole683328-Apr-16 5:41
professionalMarcusCole683328-Apr-16 5:41 
GeneralRe: Thought of the day Pin
908236528-Apr-16 5:44
908236528-Apr-16 5:44 
GeneralRe: Thought of the day Pin
Ravi Bhavnani28-Apr-16 5:46
professionalRavi Bhavnani28-Apr-16 5:46 
GeneralRe: Thought of the day Pin
jeron128-Apr-16 5:50
jeron128-Apr-16 5:50 
GeneralRe: Thought of the day Pin
Ravi Bhavnani28-Apr-16 5:51
professionalRavi Bhavnani28-Apr-16 5:51 
GeneralRe: Thought of the day Pin
jeron128-Apr-16 6:49
jeron128-Apr-16 6:49 
GeneralRe: Thought of the day Pin
Ravi Bhavnani28-Apr-16 7:38
professionalRavi Bhavnani28-Apr-16 7:38 
GeneralRe: Thought of the day Pin
jeron128-Apr-16 7:57
jeron128-Apr-16 7:57 
GeneralRe: Thought of the day Pin
Ravi Bhavnani28-Apr-16 8:21
professionalRavi Bhavnani28-Apr-16 8:21 
GeneralRe: Thought of the day Pin
jeron128-Apr-16 8:23
jeron128-Apr-16 8:23 
GeneralAPOD PinPopular
R. Giskard Reventlov28-Apr-16 4:21
R. Giskard Reventlov28-Apr-16 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.