Hi, I'm trying custom abp suite template to generate a custom method in Server.Repository.CustomCode.EfCoreRepository.Extended.txt. In the template I have used this variable: %%dto-field-names-with-type%%, and it seem abp suite didn't understand and generated that text instead of replacing by the correct content: Generated code: Here my custom content in the template: using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using %%solution-namespace%%.EntityFrameworkCore;
namespace %%solution-namespace%%.%%entity-namespace%% { public class EfCore%%entity-name%%Repository : EfCore%%entity-name%%RepositoryBase, I%%entity-name%%Repository { public EfCore%%entity-name%%Repository(IDbContextProvider<%%only-project-name%%DbContext> dbContextProvider) : base(dbContextProvider) { } public virtual async Task<List<%%entity-name%%>> GetListNoPagedAsync( string? filterText = null, %%dto-field-names-with-type%%%%<if:HasFilterableProperties>%%,%%</if:HasFilterableProperties>%% string? sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, CancellationToken cancellationToken = default) { var query = ApplyFilter((await GetQueryableAsync()), filterText%%<if:HasFilterableProperties>%%, %%</if:HasFilterableProperties>%%%%dto-field-names%%); query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? %%entity-name%%Consts.GetDefaultSorting(false) : sorting); return await query.ToListAsync(cancellationToken); } } }
3 Answer(s)
-
0
Anyone can help me on this issue? Thanks?
-
0
Hi @EngincanV, Could you please help me on this issue? Thanks
-
0
Hi, sorry for the late response. ABP Suite only populates these placeholders, those who are defined in the templates of Suite. Files with the
.Extended.*
postfixes are not re-generated by the ABP Suite and therefore those placeholders will not be populated in the next generation by Suite.Instead, you should directly write the code in the place where you defined the related placeholder.
Check out the documentation for more info: https://docs.abp.io/en/commercial/latest/abp-suite/customizing-the-generated-code