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

优化后的代码生成器del出现错误 #38

Open
ajw333 opened this issue Nov 21, 2019 · 14 comments
Open

优化后的代码生成器del出现错误 #38

ajw333 opened this issue Nov 21, 2019 · 14 comments

Comments

@ajw333
Copy link

ajw333 commented Nov 21, 2019

使用优化后的代码生成器 del 时 出现Exception has been thrown by the target of an invocation.System.NullReferenceException: Object reference not set to an instance of an object.↵ at VOL.Core.BaseProvider.ServiceBase2.Del(Object[] keys, Boolean delList) in /Users/admin/Documents/Vue.NetCore/Vue.Net2.23/VOL.Core/BaseProvider/ServiceBase.cs:line 896 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)↵ at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)↵ at VOL.Core.Controllers.Basic.BaseController1.InvokeService(String methodName, Object[] parameters) in /Users/admin/Documents/Vue.NetCore/Vue.Net2.23/VOL.Core/Controllers/Basic/BaseController.cs:line 170↵ at VOL.Core.Controllers.Basic.BaseController1.<>c__DisplayClass19_0.<Del>b__0() in /Users/admin/Documents/Vue.NetCore/Vue.Net2.23/VOL.Core/Controllers/Basic/BaseController.cs:line 136↵ at System.Threading.Tasks.Task1.InnerInvoke()↵ at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)↵--- End of stack trace from previous location where exception was thrown ---↵ at VOL.Core.Controllers.Basic.BaseController1.Del(Object[] keys) in /Users/admin/Documents/Vue.NetCore/Vue.Net2.23/VOL.Core/Controllers/Basic/BaseController.cs:line 136↵ at VOL.Core.Controllers.Basic.ApiBaseController1.Del(Object[] keys) in /Users/admin/Documents/Vue.NetCore/Vue.Net2.23/VOL.Core/Controllers/Basic/ApiBaseController.cs:line 110↵ at lambda_method(Closure , Object )↵ at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()↵ at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)↵ at System.Threading.Tasks.ValueTask`1.get_Result()↵ at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()↵ at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()↵ at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)↵ at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)↵ at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()↵ at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()↵ at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)↵ at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)↵ at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()↵ at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()↵ at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)↵ at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context)↵ at VOL.Core.Middleware.ExceptionHandlerMiddleWare.Invoke(HttpContext context) in /Users/admin/Documents/Vue.NetCore/Vue.Net2.23/VOL.Core/Middleware/ExceptionHandlerMiddleWare.cs:line 26

@cq-panda
Copy link
Owner

cq-panda commented Nov 21, 2019 via email

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

已经使用最新的代码了,具体是用代码生成器生成的一个含有导入,保存 ,新建,删除功能的页面,保存和新建,导入,导出的功能都能正常使用,就删除功能出现上面的错误

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

代码生成器未优化前,生成的代码以上功能都正常

@cq-panda
Copy link
Owner

你在ServiceBase.cs 中调试下方法Del看下具体是哪个值为null,谢谢

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

调试这句Type detailType = entityType.GetCustomAttribute().DetailTable?[0];时,时间长,获取不了信息。

@cq-panda
Copy link
Owner

你使用的是主从关系吗?是的话把主表的model截下图我看下,谢谢

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

不是

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

就一个表

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

直接跨过这一句调试就出现了上面的错误

@cq-panda
Copy link
Owner

非常感谢,获取下后台代码,点下生成model(不生成也行)

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

好的

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

以上问题解决 ,现在就是点击生成业务类代码第一次点击时出现xhr.js:172 OPTIONS http://127.0.0.1:9991/api/builder/CreateServices?tableName=Sys_Nr&nameSpace=VOL.System&foldername=Zhengming net::ERR_CONNECTION_REFUSED
coder:1 Uncaught (in promise) 网络好像出了点问题~~ 的错误,第二次点击或者多点击又正常了

@cq-panda
Copy link
Owner

image
这个代码生成页面上有介绍这个,常见问题也有描述

@ajw333
Copy link
Author

ajw333 commented Nov 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants