Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Web Development
>
Web Framework
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
9.9K
Star
14.5K
Fork
4.2K
GVP
dotNET China
/
Furion
Code
Issues
0
Pull Requests
0
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
升级 Furion 后,Sql 高级代理 在某些情况下会出现找不到参数值的 BUG
Done
#I5ERMQ
taoran
Opened this issue
2022-06-29 21:32
### Furion 版本号 3.7.0 --- ### Web 项目类型 - [x] WebApi --- ### 描述你的问题 从 3.6.0 升级到 3.7.0 之后, ``` [SqlExecute("select * from person where id >@id and name like @name")] List<Person> GetPerson(MyParam paras); [SqlProcedure("PROC_Name")] List<Person> GetPersons(MyParam dto); ``` 以上两种情况,分别会报 `Must add values for the following parameters: @id, @name` `过程或函数 'PROC_Name' 需要参数 '@XXXXX',但未提供该参数。` ``` [SqlExecute("select * from person where id >p.id and name like p.name")] List<Person> GetPerson(MyParam p); [SqlExecute("select * from person where id >@id and name like @name")] List<Person> GetPerson(int id, string name); [SqlProcedure("PROC_Name")] List<Person> GetPersons(int id); ``` 以上三种写法,不会报错 通过进一步测试发现,错误是从 3.6.3 #I5D057 开始出现的。3.6.2 及以下一切正常。 --- ### 异常堆栈信息 第一种情况: > System.InvalidOperationException: Must add values for the following parameters: @id, @name > at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext() > at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() > at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) > at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) > at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) > at Furion.DatabaseAccessor.SqlAdoNetExtensions.ExecuteReaderAsync(DatabaseFacade databaseFacade, String sql, Object model, CommandType commandType, CommandBehavior behavior, CancellationToken cancellationToken) > at Furion.DatabaseAccessor.SqlDispatchProxy.ExecuteSqlOfTAsync[T](SqlProxyMethod sqlProxyMethod) > at Furion.DatabaseAccessor.SqlDispatchProxy.InvokeAsyncT[T](MethodInfo method, Object[] args) > at Furion.Reflection.AspectDispatchProxyGenerator.InvokeAsync[T](Object[] args) > at FurionPlayground.Services.PlaygroundApiService.GetPerson(String name) in /home/runner/FurionPlayground/Services/PlaygroundApiService.cs:line 24 > at lambda_method9(Closure , Object ) > at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() > --- End of stack trace from previous location --- > at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 第二种情况: > Microsoft.Data.SqlClient.SqlException (0x80131904): 过程或函数 'PROC_Name' 需要参数 '@XXXXX',但未提供该参数。 > at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__188_0(Task`1 result) > at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() > at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj) > at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) > --- End of stack trace from previous location --- > at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) > --- End of stack trace from previous location --- > at Furion.DatabaseAccessor.SqlAdoNetExtensions.ExecuteReaderAsync(DatabaseFacade databaseFacade, String sql, Object model, CommandType commandType, CommandBehavior behavior, CancellationToken cancellationToken) > at Furion.DatabaseAccessor.SqlDispatchProxy.ExecuteSqlOfTAsync[T](SqlProxyMethod sqlProxyMethod) > at Furion.DatabaseAccessor.SqlDispatchProxy.InvokeAsyncT[T](MethodInfo method, Object[] args) > at Furion.Reflection.AspectDispatchProxyGenerator.InvokeAsync[T](Object[] args) > at FurionPlayground.Services.PlaygroundApiService.GetPerson(String name) in /home/runner/FurionPlayground/Services/PlaygroundApiService.cs:line 24 > at lambda_method14(Closure , Object ) > at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > ClientConnectionId:427d8596-71de-48fc-bbfb-246934af8a32 > Error Number:201,State:4,Class:16 --- ### 测试项目代码 https://replit.com/@staoran/FurionPlayground#Services/PlaygroundApiService.cs --- ### 数据库信息 - [x] Sqlite - [x] SqlServer
### Furion 版本号 3.7.0 --- ### Web 项目类型 - [x] WebApi --- ### 描述你的问题 从 3.6.0 升级到 3.7.0 之后, ``` [SqlExecute("select * from person where id >@id and name like @name")] List<Person> GetPerson(MyParam paras); [SqlProcedure("PROC_Name")] List<Person> GetPersons(MyParam dto); ``` 以上两种情况,分别会报 `Must add values for the following parameters: @id, @name` `过程或函数 'PROC_Name' 需要参数 '@XXXXX',但未提供该参数。` ``` [SqlExecute("select * from person where id >p.id and name like p.name")] List<Person> GetPerson(MyParam p); [SqlExecute("select * from person where id >@id and name like @name")] List<Person> GetPerson(int id, string name); [SqlProcedure("PROC_Name")] List<Person> GetPersons(int id); ``` 以上三种写法,不会报错 通过进一步测试发现,错误是从 3.6.3 #I5D057 开始出现的。3.6.2 及以下一切正常。 --- ### 异常堆栈信息 第一种情况: > System.InvalidOperationException: Must add values for the following parameters: @id, @name > at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext() > at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() > at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) > at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) > at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) > at Furion.DatabaseAccessor.SqlAdoNetExtensions.ExecuteReaderAsync(DatabaseFacade databaseFacade, String sql, Object model, CommandType commandType, CommandBehavior behavior, CancellationToken cancellationToken) > at Furion.DatabaseAccessor.SqlDispatchProxy.ExecuteSqlOfTAsync[T](SqlProxyMethod sqlProxyMethod) > at Furion.DatabaseAccessor.SqlDispatchProxy.InvokeAsyncT[T](MethodInfo method, Object[] args) > at Furion.Reflection.AspectDispatchProxyGenerator.InvokeAsync[T](Object[] args) > at FurionPlayground.Services.PlaygroundApiService.GetPerson(String name) in /home/runner/FurionPlayground/Services/PlaygroundApiService.cs:line 24 > at lambda_method9(Closure , Object ) > at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() > --- End of stack trace from previous location --- > at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 第二种情况: > Microsoft.Data.SqlClient.SqlException (0x80131904): 过程或函数 'PROC_Name' 需要参数 '@XXXXX',但未提供该参数。 > at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__188_0(Task`1 result) > at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() > at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj) > at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) > --- End of stack trace from previous location --- > at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) > --- End of stack trace from previous location --- > at Furion.DatabaseAccessor.SqlAdoNetExtensions.ExecuteReaderAsync(DatabaseFacade databaseFacade, String sql, Object model, CommandType commandType, CommandBehavior behavior, CancellationToken cancellationToken) > at Furion.DatabaseAccessor.SqlDispatchProxy.ExecuteSqlOfTAsync[T](SqlProxyMethod sqlProxyMethod) > at Furion.DatabaseAccessor.SqlDispatchProxy.InvokeAsyncT[T](MethodInfo method, Object[] args) > at Furion.Reflection.AspectDispatchProxyGenerator.InvokeAsync[T](Object[] args) > at FurionPlayground.Services.PlaygroundApiService.GetPerson(String name) in /home/runner/FurionPlayground/Services/PlaygroundApiService.cs:line 24 > at lambda_method14(Closure , Object ) > at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) > ClientConnectionId:427d8596-71de-48fc-bbfb-246934af8a32 > Error Number:201,State:4,Class:16 --- ### 测试项目代码 https://replit.com/@staoran/FurionPlayground#Services/PlaygroundApiService.cs --- ### 数据库信息 - [x] Sqlite - [x] SqlServer
Comments (
8
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(2)
C#
1
https://gitee.com/dotnetchina/Furion.git
git@gitee.com:dotnetchina/Furion.git
dotnetchina
Furion
Furion
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register