You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if you're taking 6.1.3 issues or if this is an issue in EF 7. I'll detail what I found as per your template...
Steps to reproduce
Pass MergeOption in place of ExecutionOptions
The issue
Fails with System.ArgumentException: No mapping exists from object type System.Data.IDataParameter[] to a known managed provider native type.
Exception message: System.ArgumentException: No mapping exists from object type System.Data.IDataParameter[] to a known managed provider native type.
Stack trace:
at System.Data.SqlClient.SqlCommand.<>c.b__167_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.Entity.Core.Objects.ObjectContext.d__6f1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter1.GetResult()
at System.Data.Entity.Core.Objects.ObjectContext.d__3d1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<ExecuteAsyncImplementation>d__91.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter1.GetResult() at System.Data.Entity.Core.Objects.ObjectContext.<ExecuteStoreQueryReliablyAsync>d__6c1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Tonic.Oms.Api.Tests.CoreTests.d__25.MoveNext() in E:\Projects\oms-platform\Tonic.Oms.Api\Tonic.Oms.Api.Tests\CoreTests.cs:line 432
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Further technical details
The code that reproduces this issue is...
IDataParameter[] parameters = new IDataParameter[] {
repository.CreateStoreQueryParameter("@LogonId", logonId),
repository.CreateStoreQueryParameter("@Password", password),
repository.CreateStoreQueryParameter("@status", status)};
var list = await repository.ModelObjectContext.ExecuteStoreQueryAsync<UserPasswordEntity>(
commandText,
MergeOption.AppendOnly,
parameters);
Now it took me an afternoon to notice as this code compiles, runs then fails with a run time error, but the 2nd parameter should actually be of type ExecutionOptions and not a MergeOption enum. I don't know how this compiles, but it does, I'm guessing somewhere out there is an explicit cast operator from MergeOption to ExecutionOptions.
So when you pass ExecutionOptions it executes successfully...
ExecutionOptions options = new ExecutionOptions(MergeOption.AppendOnly);
IDataParameter[] parameters = new IDataParameter[] {
repository.CreateStoreQueryParameter("@LogonId", logonId),
repository.CreateStoreQueryParameter("@Password", password),
repository.CreateStoreQueryParameter("@status", status)};
var list = await repository.ModelObjectContext.ExecuteStoreQueryAsync<UserPasswordEntity>(
commandText,
options,
parameters);
I came across this error converting synchronous code to async. There is a synchronous method which takes MergeOption as a parameter.
EF version: 6.1.3
Operating system: Windows 10
Visual Studio version: VS 2015
Other details about my project setup:
The text was updated successfully, but these errors were encountered:
I'm not sure if you're taking 6.1.3 issues or if this is an issue in EF 7. I'll detail what I found as per your template...
Steps to reproduce
Pass MergeOption in place of ExecutionOptions
The issue
Fails with System.ArgumentException: No mapping exists from object type System.Data.IDataParameter[] to a known managed provider native type.
Exception message: System.ArgumentException: No mapping exists from object type System.Data.IDataParameter[] to a known managed provider native type.
Stack trace:
at System.Data.SqlClient.SqlCommand.<>c.b__167_0(Task
1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke()at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.Entity.Core.Objects.ObjectContext.d__6f
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter
1.GetResult()at System.Data.Entity.Core.Objects.ObjectContext.d__3d
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<ExecuteAsyncImplementation>d__9
1.MoveNext()--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter
1.GetResult() at System.Data.Entity.Core.Objects.ObjectContext.<ExecuteStoreQueryReliablyAsync>d__6c
1.MoveNext()--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Tonic.Oms.Api.Tests.CoreTests.d__25.MoveNext() in E:\Projects\oms-platform\Tonic.Oms.Api\Tonic.Oms.Api.Tests\CoreTests.cs:line 432
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Further technical details
The code that reproduces this issue is...
Now it took me an afternoon to notice as this code compiles, runs then fails with a run time error, but the 2nd parameter should actually be of type ExecutionOptions and not a MergeOption enum. I don't know how this compiles, but it does, I'm guessing somewhere out there is an explicit cast operator from MergeOption to ExecutionOptions.
So when you pass ExecutionOptions it executes successfully...
I came across this error converting synchronous code to async. There is a synchronous method which takes MergeOption as a parameter.
EF version: 6.1.3
Operating system: Windows 10
Visual Studio version: VS 2015
Other details about my project setup:
The text was updated successfully, but these errors were encountered: