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

Cannot generate crud code from entity. #141

Open
dangminhbk opened this issue Mar 27, 2021 · 6 comments
Open

Cannot generate crud code from entity. #141

dangminhbk opened this issue Mar 27, 2021 · 6 comments

Comments

@dangminhbk
Copy link

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.

@gdlcf88 gdlcf88 transferred this issue from EasyAbp/AbpHelper.GUI Mar 27, 2021
@wakuflair
Copy link
Member

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

@dangminhbk
Copy link
Author

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
Copy link

blyzer commented Apr 2, 2021

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

@dangminhbk
Copy link
Author

`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
Copy link
Member

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

@AbdullahEliwa
Copy link

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

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

4 participants