Activities of "liangshiwei"

This produces 2 parameters, one for the route {testClass} with no Type and one for the function itself with the correct type info. So this seems to be the culprit here

Yes, I think this may be related to ASP.NET Core

Sorry for that.

I made a new example, what's your email? I will share it with you.

When you receive the example, you need to replace AbpLicenseCode with yours. And update the Nuget.config file

You can use // real-time to search all relevant codes.

Hi,

I think it's possible.

You can manually install System.Runtime package into the winform app.

pls tell me how to call authorized app services with HttpClient? Thank you.

You can check this: https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs#L30

ok

Ok, I think I explained it above: You can replace the OrganizationUnitManager to override the GetNextChildCodeAsync method

For example:

[ExposeServices(typeof(OrganizationUnitManager))]
public class MyOrganizationUnitManager : OrganizationUnitManager
{
    public override async Task<string> GetNextChildCodeAsync(Guid? parentId)
    {
        var code = await base.GetNextChildCodeAsync(parentId);
        return code.SubString(2);
    }
}

For Example, if we need to change the CodeUnitLength, as it is a static class, we can't Override, so what is the right way to do it?

It's not a big problem.

You can change the length of the OrganizationUnit entity:

protected override void OnModelCreating(ModelBuilder builder)
{
    .....
    
    // Update the code length
    builder.Entity<OrganizationUnit>(b => 
    {
        b.Property(x => x.Code).HasMaxLength(10);
    });
}

dotnet ef migratons add change_code_length dotnet ef database update

Hi,

Something which can hold the values of the variable till the page is refreshed or the instance of the class is destroyed.

The server is stateless, you must re-call the app service or temporarily store the value. you can consider using Session to store values.

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-8.0 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-8.0#set-and-get-session-values

Hi, You can try update the CreateExtraFields method

private async Task CreateExtraFields()
{
    ....

    Fields ??= new List<Field>();

    foreach (var item in QuestionDtos)
    {
        var choices = new List<SelectListItem>();

        foreach (var choice in item.Choices)
        {
            choices.Add(new SelectListItem()
            {
                Text = choice.Value,
                Value = choice.Value
            });
        }

        Field field = Fields.FirstOrDefault(x => x.Title == item.Title) ?? new Field();
        field.Index = item.Index;

        field.Index = item.Index;
        field.Title = item.Title;
        field.IsRequired = item.IsRequired;
        field.HasOtherOption = item.HasOtherOption;
        field.QuestionType = item.QuestionType;
        field.Choices = choices;

        Fields.AddIfNotContains(x => x.Title == field.Title ,() =>field);
    }
}

And OnPostAsync method

public virtual async Task<IActionResult> OnPostAsync()
{
    try
    {
        await CheckSelfRegistrationAsync();
        await SetUseCaptchaAsync();
        await CreateExtraFields(); add this line
        
        ....
    }
  
   ....
}   

The cshtml

...
case QuestionTypes.ShortText:
    <div class="form-floating mb-2">
        <input type="hidden" asp-for="@Model.Fields[i].Title" /> // keep this line
        <input asp-for="@Model.Fields[i].Answer" required="@Model.Fields[i].IsRequired" type="text" class="form-control" auto-focus="true">
        @Html.Label(Model.Fields[i].Title)
    </div>
    break;

case QuestionTypes.ParagraphText:
    <div class="form-floating mb-2">
        <input type="hidden" asp-for="@Model.Fields[i].Title" /> // keep this line
        <input asp-for="@Model.Fields[i].Answer" required="@Model.Fields[i].IsRequired" type="text" class="form-control" auto-focus="true">
        @Html.Label(Model.Fields[i].Title)
    </div>
    break;
....

Hi,

You can replace the IRemoteServiceHttpClientAuthenticator in integration test.

For example:

public class IntegrationTestRemoteServiceHttpClientAuthenticator : IRemoteServiceHttpClientAuthenticator
{
    public virtual Task Authenticate(RemoteServiceHttpClientAuthenticateContext context)
    {
        return Task.CompleteTask;
    }
}
if(isTest)
{
    ....
    context.Services.RemoveAll(x => x.ServiceType == typeof(IRemoteServiceHttpClientAuthenticator));
    context.Services.AddTransient<IRemoteServiceHttpClientAuthenticator, IntegrationTestRemoteServiceHttpClientAuthenticator>();
}
Answer

Hi,

This may be a naming convention issue,

When one implements multiple interfaces, ABP doesn't know which one to register, So ABP uses the naming convention.

For example:

public interface IDapperBookRepository
{
    
}


public class DapperBookRepository: DapperRepository<xxx>, IDapperBookRepository, ITransientDependency
{
    
}
Showing 2721 to 2730 of 6692 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 15, 2025, 10:51