Dapper.Contrib Insert returns long but InsertAsync returns int
In Dapper.Contrib the Insert method returns a long but InsertAsync returns an int. Could you have both returning the same for consistency please? I personally would prefer int (32 bits) but I understand some people might need long (64 bits).
What's interesting is that returnVal internally is defined as an int. You should be able to safely cast it to an int.
I, too, had this problem in production when a certain amount of rows in a table were surpassed (int.maxvalue) and the method signature of the Insert<T> method didn't immediately give away the problem.
So either change everything to long, or add additional methods, aka InsertLong, ect. ..
However, the method signature right now is misleading, or "wrong" if you will.
Is this somehow addressed?
@kamil-mrzyglod I solved it by cloning the repo and replacing the respective code (its only at 2-3 places).
@ThomasBergholdWieser Naah, it's not exactly the solution I'm seeking right now.
What if the Id to be returned is string or Guid?
Will this be ever addressed or is dapper contrib team not planning to support this?