EasyAbp / AbpHelper.CLI

Providing code generation and more features to help you develop applications and modules with the ABP framework.
MIT License
285 stars 95 forks source link

Cannot generate crud code from entity. #141

Open dangminhbk opened 3 years ago

dangminhbk commented 3 years ago

I have an Entity in directory like: POS\aspnet-core\src\MDH.POS.Domain\Products\Admin have namespace MDH.POS.Products.Admin. I try crud generation and it not work. I try AppService generation and it work. I have also try to generate entity from MDH.POS.Products and it work like a charm. So as my guess, AbpHelper only generate code from level 1 entity.

wakuflair commented 3 years ago

Can you provide more details about not work?(error logs etc.)

dangminhbk commented 3 years ago

Here is the log ] Parsing entity failed.

2021-03-31 13:28:42.477 +07:00 [INF] Use directory: C:\Study\POS 2021-03-31 13:28:42.699 +07:00 [INF] Command 'crud' started. 2021-03-31 13:28:42.838 +07:00 [DBG] ProjectInfoProviderStep Input [baseDirectory]: 'C:\Study\POS' 2021-03-31 13:28:42.839 +07:00 [DBG] ProjectInfoProviderStep Input [excludeDirectories]: 2021-03-31 13:28:43.023 +07:00 [DBG] ProjectInfoProviderStep Output [projectInfo]: 'BaseDirectory: C:\Study\POS, FullName: MDH.POS, Name: POS, TemplateType: Application, UiFramework: RazorPages, Tiered: True' 2021-03-31 13:28:43.028 +07:00 [DBG] FileFinderStep Input [baseDirectory]: 'C:\Study\POS' 2021-03-31 13:28:43.028 +07:00 [DBG] FileFinderStep Input [excludeDirectories]: 2021-03-31 13:28:43.030 +07:00 [DBG] FileFinderStep Input [searchFileName]: 'ProductAdmin.cs' 2021-03-31 13:28:43.032 +07:00 [DBG] FileFinderStep Input [errorIfNotFound]: 'True' 2021-03-31 13:28:43.077 +07:00 [DBG] FileFinderStep Output [filePathName]: Found file: 'C:\Study\POS\aspnet-core\src\MDH.POS.Domain\Products\Admin\ProductAdmin.cs', stored in parameter: 'FileFinderResult' 2021-03-31 13:28:43.094 +07:00 [DBG] EntityParserStep Input [entityFile]: 'C:\Study\POS\aspnet-core\src\MDH.POS.Domain\Products\Admin\ProductAdmin.cs' 2021-03-31 13:28:43.225 +07:00 [ERR] Parsing entity failed. System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate) at EasyAbp.AbpHelper.Core.Steps.Abp.EntityParserStep.OnExecuteAsync(WorkflowExecutionContext context, CancellationToken cancellationToken) 2021-03-31 13:28:43.230 +07:00 [ERR] Error while invoking activity activity-8 of workflow 86ce987428734e9b88ce1e3f09315433 System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate) at EasyAbp.AbpHelper.Core.Steps.Abp.EntityParserStep.OnExecuteAsync(WorkflowExecutionContext context, CancellationToken cancellationToken) at Elsa.Services.ActivityInvoker.InvokeAsync(WorkflowExecutionContext workflowContext, IActivity activity, Func`2 invokeAction) 2021-03-31 13:28:43.244 +07:00 [ERR] Error activity: { "Name": null }

blyzer commented 3 years ago

@dangminhbk are you using enums or list generated in any step of your source code?

dangminhbk commented 3 years ago

`namespace MDH.POS.Products.Admin { public class ProductAdmin : Product { public string Name { get; set; } } }

namespace MDH.POS.Products { public class Product : FullAuditedAggregateRoot, IMultiTenant { public Guid? TenantId { get; set; } } }

`

@blyzer no, it is very simple entity.

wakuflair commented 3 years ago

It seems that AbpHelper doesn't handle derived entities properly. I will check it.

AbdullahEliwa commented 2 years ago

@wakuflair Any updates ? AbpHeleper now can handle it ? Appreciating your help.