title: Dapper.Contrib - "only supports an entity with a single [Key] or [ExplicitKey]"
body: <p>I'm using <code>Dapper</code> and <code>Dapper.Contrib</code> in an MVC5 c# environment and sometimes (!) when I deploy the production site I get errors stating:</p>
  
  <blockquote>
    <p><code>GetAll&lt;T&gt;</code> only supports an entity with <strong>a single [Key] or [ExplicitKey]</strong>
    property    at
    Dapper.Contrib.Extensions.SqlMapperExtensions.GetSingleKey[T](String
    method)    at
    Dapper.Contrib.Extensions.SqlMapperExtensions.GetAllAsync[T](IDbConnection
    connection, IDbTransaction transaction, Nullable`1 commandTimeout)</p>
  </blockquote>
  
  <p>This only happens about one every third deploy though. </p>
  
  <p>I'm suspecting that somehow <code>Dapper.Contrib</code> notices my primary key automatically, as it's named <em>"Id"</em>, but I've decorated it with <code>[ExplicitKey]</code> (it's a GUID) and perhaps those attributes clash. Perhaps it's something entirely different... </p>
  
  <p>Any idea on how to get around this problem, other than possibly renaming my primary key?</p>
  
  <p>A piece from the model in question:</p>
  
  <pre><code>[Table("Tasks")]
  public class TasksModel
  {
      [ExplicitKey]
      public Guid Id { get; set; }
  
  ...
  </code></pre>