title: Why is there an ambiguous method call between long, float and decimal methods when using a long as a paramater?
body: <p>I am trying to build a <code>NpgsqlSimpleTypeHandler&lt;ulong&gt;</code> to handle converting <code>ulong</code> values to <code>long</code> values so they can be stored in my PostgreSQL database, and vise-versa.</p>
  <p>When I try and call Npgsql's <code>Int64handler.ValidtaeAndGetLength</code> after converting a <code>ulong</code> to a <code>long</code> with <code>Convert.ToInt64(value)</code>, attempting to pass the newly converted <code>long</code> gives me an ambiguous method call error.</p>
  <pre><code>private readonly Int64Handler handler;
  ...
  public override int ValidateAndGetLength(ulong value, NpgsqlParameter? parameter)
  {
      long val = Convert.ToInt64(value);
      return handler.ValidateAndGetLength(val, parameter);
  }
  </code></pre>
  <p>Error Message:</p>
  <pre><code>Error   CS0121
  The call is ambiguous between the following methods or properties:
  'Int64Handler.ValidateAndGetLength(float, NpgsqlParameter?)' and
  'Int64Handler.ValidateAndGetLength(decimal, NpgsqlParameter?)'
  </code></pre>
  <p>Why, when even with <code>Int64Handler.ValidateAndGetLength(long, NpgsqlParameter?)</code> exsisting, do I wind up with the ambiguous method call error?</p>
  <p><a href="https://www.npgsql.org/doc/api/Npgsql.TypeHandlers.NumericHandlers.Int64Handler.html" rel="nofollow noreferrer"><em>Npgsql Int64Handler documentation</em></a></p>
  <p><em>[7/21/2020 14:23 EST] Updated tags to include C#-8.0</em></p>