title: Invalid cast exception on command.Parameters.GetValue<long>
body: <p>I have some ADO.Net code as below, it successfully execute the SP in DB, while it throws exception at tenantId, please guide me on it.</p>
  
  <pre><code>            command.Parameters.Input.BigInt(ParameterConstants.TenantId)
                                      .BigInt(ParameterConstants.PartyId, tenant.PartyId)
                                      .Varchar(ParameterConstants.TenantCode, tenant.TenantCode)
                                      .BigInt(ParameterConstants.PharmaId, tenant.PharmaId)
                                      .BigInt(ParameterConstants.UserId, userProfileId);
  
              command.ExecuteNonQuery();
  
              var tenantId = command.Parameters.GetValue&lt;long&gt;(ParameterConstants.TenantId);
  </code></pre>
  
  <p>at <code>var tenantId</code> it throws cast exception <code>System.InvalidCastExceptio</code>...
  exact exception <code>Specified cast is not valid.</code></p>
  
  <pre><code>An exception of type 'System.InvalidCastException' occurred in ...Data.dll but was not handled in user code
  
  Additional information: Specified cast is not valid.
  </code></pre>