Activities of "maliming"

sorry,


var defaultLanguage = await _settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage); 
var (cultureName, uiCultureName) = LocalizationSettingHelper.ParseLanguageSetting(defaultLanguage);
using (CultureHelper.Use(CultureInfo.GetCultureInfo(cultureName))) 
{ 
    GenerateViolationReport() 
} 

hi

Add the below code to your web project.

This may cause issues, because by design the key name in the dictionary is not camelCase


Configure<JsonOptions>(options =>
{
    options.JsonSerializerOptions.Converters.Add(new MyJsonConverter());
});
public class MyJsonConverter : JsonConverter<IdentityUserDto>
{
    private JsonSerializerOptions _readJsonSerializerOptions;
    private JsonSerializerOptions _writeJsonSerializerOptions;

    public override IdentityUserDto Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
    {
        _readJsonSerializerOptions ??= new JsonSerializerOptions(options)
        {
            DictionaryKeyPolicy = JsonNamingPolicy.CamelCase
        };
        _readJsonSerializerOptions.Converters.RemoveAll(x => x.GetType() == typeof(MyJsonConverter));

        return JsonSerializer.Deserialize(ref reader, typeToConvert, _readJsonSerializerOptions).As<IdentityUserDto>();
    }

    public override void Write(Utf8JsonWriter writer, IdentityUserDto value, JsonSerializerOptions options)
    {
        _writeJsonSerializerOptions ??= new JsonSerializerOptions(options)
        {
            DictionaryKeyPolicy = JsonNamingPolicy.CamelCase
        };
        _writeJsonSerializerOptions.Converters.RemoveAll(x => x.GetType() == typeof(MyJsonConverter));
        
        JsonSerializer.Serialize(writer, value, _writeJsonSerializerOptions);
    }
}


: )

hi

I guess can i access subfields with a '.' after ExtraProperties?

I think you can do that. https://docs.abp.io/en/abp/latest/Object-Extensions#getproperty

hi

Please share the logs of this request. Thanks

Answer

hi

Could you please let me know why this does not work anymore? Maybe it has something to do with the ABP version upgrade? If I remember it right, it was done for 4.x.

Does everything work fine if you don't upgrade?

hi

here I want to set defaultLanguage to use it in GenerateViolationReport() method

hi

You can switch the current culture

// get defaultLanguage for this tenant
var defaultLanguage = await _settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);

// here I want to set defaultLanguage to use it in GenerateViolationReport() method 

using (CultureHelper.Use(CultureInfo.GetCultureInfo(defaultLanguage)))
{
    GenerateViolationReport()
}

hi

I will contact you by WeChat.

hi @abpVAndy

请分享这个请求的详细日志. 请把日志级别调整到最低Trace或者Debug

if you could just point us in the direction of an example that does what we're trying to achieve

ok, Please create a new brand project and send it to me, I will update it and get back to you. liming.ma@volosoft.com

Showing 9861 to 9870 of 12938 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.8.0-preview. Updated on November 12, 2026, 06:07
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.