title: dapper nuget 1.7 enums mapping
body: <p>I've encountered an issue after I upgraded to the latest version of Dapper from Nuget (v 1.7).</p>
  
  <p>It always return the first enums member (that is, it fail to maps).  </p>
  
  <p>I am using MySQL as the database.</p>
  
  <pre><code>CREATE TABLE `users_roles` (
      `userId` INT(11) NOT NULL,
      `roleId` INT(11) NOT NULL,  
      KEY `user_id` (`userId`),
      KEY `role_id` (`roleId`)
  );
  
  INSERT INTO `users_roles` (`userId`, `roleId`) VALUES (1, 1);
  INSERT INTO `users_roles` (`userId`, `roleId`) VALUES (2, 2);
  
  public enum Role { 
    Anonymous = 0, Authenticate = 1, Administrator = 2
  }
  
  var role = Current.Db.Query&lt;Role&gt;(@"SELECT roleId as Role FROM users_roles
      WHERE userId=@id", new { id = 2 }).FirstOrDefault();
  </code></pre>
  
  <p>It gives the expected output in Dapper nuget v1.6.  Is this the correct behavior for the new version (1.7)?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>After doing some testing with a few console application and fresh mvc3 appications I found that the behavior of Dapper enum mapping is inconsistent when you map the enum type directly.</p>
  
  <p>However, mapping an enum as a property of a class somehow consistently returns the correct map</p>
  
  <pre><code>public class User
  {
     public int Id { get; set; }
     public Role Role { get; set; }
  }
  
  var user = Current.Db.Query&lt;User&gt;(@"SELECT roleId as Role, userId as Id 
      FROM users_roles
      WHERE userId=@id", new { id = 2 }).FirstOrDefault();
  </code></pre>
  
  <p>the result of user.Role somehow returns the expected output</p>