diff --git a/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs b/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs index 6d480063..dc5977d9 100644 --- a/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs +++ b/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs @@ -35,6 +35,11 @@ CSharpSyntaxNode MainMenu(CSharpSyntaxNode root) => root.Descendants root.NotContains(usingForAppText) )); + builders.Add(new DeletionBuilder( + root => MainMenu(root).GetEndLine() - 1, + root => MainMenu(root).GetEndLine() - 1, + modifyCondition: root => !root.NotContains("return Task.CompletedTask;") + )); builders.Add( new InsertionBuilder( root => MainMenu(root).GetEndLine(), diff --git a/src/AbpHelper.Core/Templates/Crud/MenuContributor_UsingForApp b/src/AbpHelper.Core/Templates/Crud/MenuContributor_UsingForApp index 005339c8..c7cbc5df 100644 --- a/src/AbpHelper.Core/Templates/Crud/MenuContributor_UsingForApp +++ b/src/AbpHelper.Core/Templates/Crud/MenuContributor_UsingForApp @@ -1,3 +1,4 @@ {{~ if !Option.SkipPermissions ~}} using {{ ProjectInfo.FullName }}.Permissions; {{~ end ~}} + private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)