Activities of "liangshiwei"

Hi,

I think you shouldn't stop the application from crashing if Redis server is not available

In distributed and microservice applications, distributed caching is necessary. It's like SQLServer. Imagine if the SQLServer is unavailable, will you choose to keep the application running?

You can check this: https://support.abp.io/QA/Questions/6344/Why-do-we-need-to-install-Redis-When-is-it-used-Why-Redis-is-needed

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>();
}
Showing 2721 to 2730 of 6693 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 17, 2025, 07:08
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.