Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: DirectionalQueryField broken in 1.13.1 #1145

Open
kiwidude68 opened this issue Apr 15, 2023 · 2 comments
Open

Bug: DirectionalQueryField broken in 1.13.1 #1145

kiwidude68 opened this issue Apr 15, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@kiwidude68
Copy link

Bug Description

The 1.13 releases have broken DirectionalQueryField parameters (I reported this on Gitter a while ago but it got overlooked).

Exception Message:

System.ArgumentException
  HResult=0x80070057
  Message=No mapping exists from object type System.RuntimeType to a known managed provider native type.
  Source=Microsoft.Data.SqlClient
  StackTrace:
   at Microsoft.Data.SqlClient.MetaType.GetMetaTypeFromValue(Type dataType, Object value, Boolean inferLen, Boolean streamAllowed)
   at Microsoft.Data.SqlClient.MetaType.GetMetaTypeFromType(Type dataType)
   at Microsoft.Data.SqlClient.SqlParameter.GetMetaTypeOnly()
   at Microsoft.Data.SqlClient.SqlParameter.Validate(Int32 index, Boolean isCommandProc)
   at Microsoft.Data.SqlClient.SqlCommand.SetUpRPCParameters(_SqlRPC rpc, Boolean inSchema, SqlParameterCollection parameters)
   at Microsoft.Data.SqlClient.SqlCommand.BuildRPC(Boolean inSchema, SqlParameterCollection parameters, _SqlRPC& rpc)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at RepoDb.DbConnectionExtension.ExecuteNonQueryInternal(IDbConnection connection, String commandText, Object param, Nullable`1 commandType, Nullable`1 commandTimeout, String traceKey, IDbTransaction transaction, ITrace trace, Type entityType, DbFieldCollection dbFields, Boolean skipCommandArrayParametersCheck)
   at RepoDb.DbConnectionExtension.ExecuteNonQuery(IDbConnection connection, String commandText, Object param, Nullable`1 commandType, String traceKey, Nullable`1 commandTimeout, IDbTransaction transaction, ITrace trace)
   at RepoDbTest.Program.Main(String[] args) in D:\Dev\Misc\Projects\RepoDbTest\Program.cs:line 23

Replicating

Just use your own documentation example code from here:
https://repodb.net/class/directionalqueryfield

Note there is a typo in those docs too of ParamDirection rather than ParameterDirection.

You don't even need database objects, the runtime error will happen as soon as it attempts to convert the QueryField array into sql parameters.

The same code will work fine with RepoDb 1.12.10 / 1RepoDb.SqlServer .1.5

Library Version:

RepoDb v1.13.1 and RepoDb.SqlServer v1.13.1

@kiwidude68 kiwidude68 added the bug Something isn't working label Apr 15, 2023
@mikependon mikependon pinned this issue Apr 15, 2023
@al-nixon
Copy link

Hello, I also have encountered this error. Would a status update or a work around be available on this issue? Thanks

@kiwidude68
Copy link
Author

Hello, I also have encountered this error. Would a status update or a work around be available on this issue? Thanks

I gave up mate, the product is dead as far as I am concerned, no updates for a year. We just went with Dapper instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants