Starts in:
2 DAYS
3 HRS
19 MIN
24 SEC
Starts in:
2 D
3 H
19 M
24 S

Activities of "thanhlg"

Hi liangshiwei,

I have sent you an email, please check and assist me. Thanks.

Check the docs before asking a question: How to use extended field query in EF query?, [Filter User list by new extra property #784](https://support.abp.io/QA/Questions/784/Filter-User-list-by-new-extra-property), How to add custom property to the user entity,Module Entity Extensions | Documentation Center | ABP.IO ...

  • ABP Framework version: v8.0.2
  • UI Type: Blazor WASM / Blazor Server
  • Database System: EF Core (PostgreSQL)

Hi Support Teams,

I have two questions:

  1. Is there a way to use ScreenUrl within ExtraProperties instead of creating an additional ScreenUrl column and using EF.Property(u, "ScreenUrl") to write the query statement?

Below is my code.

2. How can I add `context.GetHttpContext().Request.Headers["screen-url"]` to the `ScreenUrl` column in `EntityChanges`? Currently, when I run it, it only adds it to the `ScreenUrl` in `ExtraProperties` but doesn't save it to the newly added `ScreenUrl` column.

public class ExtendedAuditLogContributor : AuditLogContributor
{
    public override void PreContribute(AuditLogContributionContext context)
    {  
        context.AuditInfo.SetProperty(
        "ScreenUrl",
            context.GetHttpContext().Request.Headers["screen-url"]
        );

    }

    public override void PostContribute(AuditLogContributionContext context)
    {
        var currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>();
         
        foreach (var change in context.AuditInfo.EntityChanges)
        {
            change.SetProperty(
            "ScreenUrl",
            context.GetHttpContext().Request.Headers["screen-url"]);

            change.SetProperty(
            "UserId", currentUser.Id); 
        }
    }
}

What if the data exceeds int.MaxValue?

[ExposeServices(typeof(IAuditLogsAppService))] 
public class MyAuditLogsAppService : AuditLogsAppService 
{ 
    public MyAuditLogsAppService(IAuditLogRepository auditLogRepository, IJsonSerializer jsonSerializer, IPermissionChecker permissionChecker, IPermissionDefinitionManager permissionDefinitionManager) : base(auditLogRepository, jsonSerializer, permissionChecker, permissionDefinitionManager) 
    { 
    } 
} 

Can you help me write the GetEntityChangesAsync(GetEntityChangesDto input) method without being limited by MaxResultCount?

public override void ConfigureServices(ServiceConfigurationContext context)  
{  
    LimitedResultRequestDto.MaxMaxResultCount = int.MaxValue;  
    ExtensibleLimitedResultRequestDto.MaxMaxResultCount = int.MaxValue;  
}  
  

Thanks for the support, but if I don't use this configuration, can you help me rewrite the 'GetEntityChanges' method without using pagination and without limiting the number of results?

and I would like to be able to retrieve more than 1000 records because the current MaxResultCount limit is 1000.

You can try:

public override void ConfigureServices(ServiceConfigurationContext context) 
{ 
    ExtensibleLimitedResultRequestDto.MaxMaxResultCount = int.MaxValue; 
} 
 

Thank you very much.

Could you please clarify if it is possible to filter data when retrieving a list of EntityChanges using ExtraProperties? I would like to retrieve a list of data where ScreenUrl in ExtraProperties is equal to the URL of the currently opened page. Additionally, I need to filter multiple EntityIds within the same page. How can this be achieved? Could you provide me with some suggestions?

Hi, I apologize for the complexity of my question. I want to add ScreenUrl and UserId to ExtraProperties of EntityChanges (currently only possible to store in the ExtraProperties of AuditLogs), and I would like to be able to retrieve more than 1000 records because the current MaxResultCount limit is 1000.

Hi Abp Support Team, How can I retrieve more than 1000 records with MaxResultCount and... I added ScreenUrl to AuditLogs like this: I want to add ScreenUrl and CurrentUser.Id to EntityChanges. How can I do that? Is there any way to retrieve multiple EntityIds on the same page? For example, I have a Customer page. The page has one EntityId of the Customer table, which I have set as DocId in the code. Inside the page, I have a grid that stores data for the CustomerABC table, which will have another EntityId. I have added ScreenUrl to AuditLogs to retrieve the information of the page where the changes were made, but when there are more than 1000 records, retrieving the data is not accurate. I have switched to filtering EntityIds based on the DocId of the currently opened page to narrow down the data. However, using this approach, if the page contains child tables with different entities, I cannot retrieve the data of those tables. Could you provide an example of how to handle this request? Thanks,

I sent the project

thanhlg@xxxx.com.vn

It worked. Thank you very much.🌻

Showing 41 to 50 of 57 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06