It seems that it doesn't work when TVP class contains enum.
I get exception:
Result Message: System.InvalidCastException : Specified cast is not valid.
Result StackTrace:
at Microsoft.SqlServer.Server.SqlDataRecord.SetValue(Int32 ordinal, Object value)
at CodeOnlyStoredProcedure.TableValuedParameter.CrateValuedParameter(IEnumerable table, Type enumeratedType)
at CodeOnlyStoredProcedure.TableValuedParameter.CreateDbDataParameter(IDbCommand command)
at CodeOnlyStoredProcedure.StoredProcedure.AddParameters(IDbCommand cmd)
at CodeOnlyStoredProcedure.StoredProcedure3.Execute(IDbConnection connection, CancellationToken token, Int32 timeout) at CodeOnlyStoredProcedure.StoredProcedure3.Execute(IDbConnection connection, Int32 timeout)
Hmmm, I could have sworn I've tried that before. Could you provide the signature of the TVP in SQL server, as well as the class you're using to pass it?
It seems that it doesn't work when TVP class contains enum. I get exception: