Fix perf with cache
This commit is contained in:
@@ -129,7 +129,27 @@ public static class PostgreSqlMappers
|
||||
AgentName = entity.AgentName,
|
||||
AvatarUrl = entity.AvatarUrl,
|
||||
TelegramChannel = entity.TelegramChannel,
|
||||
Id = entity.Id // Assuming Id is the primary key for UserEntity
|
||||
Id = entity.Id, // Assuming Id is the primary key for UserEntity
|
||||
Accounts = entity.Accounts?.Select(MapAccountWithoutUser).ToList() ?? new List<Account>()
|
||||
};
|
||||
}
|
||||
|
||||
// Helper method to map AccountEntity without User to avoid circular reference
|
||||
private static Account MapAccountWithoutUser(AccountEntity entity)
|
||||
{
|
||||
if (entity == null) return null;
|
||||
|
||||
return new Account
|
||||
{
|
||||
Id = entity.Id,
|
||||
Name = entity.Name,
|
||||
Exchange = entity.Exchange,
|
||||
Type = entity.Type,
|
||||
Key = entity.Key,
|
||||
Secret = entity.Secret,
|
||||
User = null, // Don't map User to avoid circular reference
|
||||
Balances = new List<Balance>(), // Empty list for now, balances handled separately if needed
|
||||
IsGmxInitialized = entity.IsGmxInitialized
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user