title: How to get an object with change tracking in Dapper .Contrib?
body: <p>I've been playing with Dapper-Contrib for a bit and having problem retrieving an object using .Get so that I can maintain change tracking for the object. </p>
  
  <p>My Interface:</p>
  
  <pre><code>Imports Dapper.Contrib.Extensions
  
  Public Interface ICountry
  
      &lt;Key&gt;
      Property CountryGUID As Guid
      Property Country As String
  
  End Interface
  </code></pre>
  
  <p>The Class:</p>
  
  <pre><code>Imports Dapper.Contrib.Extensions
  
  &lt;Table("Country")&gt;
  Public Class Country
      Implements ICountry
      &lt;Key&gt;
      Public Property CountryGUID As Guid Implements ICountry.CountryGUID
      Public Property Country As String Implements ICountry.Country
  
  End Class
  </code></pre>
  
  <p>My function:</p>
  
  <pre><code>   Public Function Find(countryId As Guid) As ICountry
          Dim country As ICountry
  
          Using conn = New SqlConnection(ConnectionString)
              conn.Open()
  
              country = conn.Get(Of ICountry)(countryId)
  
              conn.Close()
          End Using
  
          Return country
      End Function
  </code></pre>
  
  <p>And I got an error saying <strong>Invalid object name 'Countrys'</strong> when calling the above function.</p>
  
  <p>The problem seems to be caused by Dapper sqlmapperextensions automatically adds “s” to tablename and that can be solved by defining TableAttribute. However, TableAttribute is supported for classes only but not interfaces. </p>
  
  <p>Please note that I have to call <code>.Get</code> with an interface to have tracking functionality. </p>