Enhance PostgreSqlBacktestRepository to include PositionCount in backtest mappings

- Updated the mapping logic in multiple methods to include PositionCount alongside existing fields such as NetPnl, Score, and InitialBalance.
This commit is contained in:
2025-12-12 01:44:34 +07:00
parent 5328d760dd
commit 87bc2e9dce

View File

@@ -193,7 +193,8 @@ public class PostgreSqlBacktestRepository : IBacktestRepository
Score = entity.Score, Score = entity.Score,
ScoreMessage = entity.ScoreMessage ?? string.Empty, ScoreMessage = entity.ScoreMessage ?? string.Empty,
InitialBalance = entity.InitialBalance, InitialBalance = entity.InitialBalance,
NetPnl = entity.NetPnl NetPnl = entity.NetPnl,
PositionCount = entity.PositionCount
}); });
return (mappedBacktests, totalCount); return (mappedBacktests, totalCount);
@@ -269,7 +270,8 @@ public class PostgreSqlBacktestRepository : IBacktestRepository
Score = entity.Score, Score = entity.Score,
ScoreMessage = entity.ScoreMessage ?? string.Empty, ScoreMessage = entity.ScoreMessage ?? string.Empty,
InitialBalance = entity.InitialBalance, InitialBalance = entity.InitialBalance,
NetPnl = entity.NetPnl NetPnl = entity.NetPnl,
PositionCount = entity.PositionCount
}); });
return (mappedBacktests, totalCount); return (mappedBacktests, totalCount);
@@ -590,7 +592,8 @@ public class PostgreSqlBacktestRepository : IBacktestRepository
Score = entity.Score, Score = entity.Score,
ScoreMessage = entity.ScoreMessage ?? string.Empty, ScoreMessage = entity.ScoreMessage ?? string.Empty,
InitialBalance = entity.InitialBalance, InitialBalance = entity.InitialBalance,
NetPnl = entity.NetPnl NetPnl = entity.NetPnl,
PositionCount = entity.PositionCount
}); });
return (mappedBacktests, totalCount); return (mappedBacktests, totalCount);
@@ -732,7 +735,8 @@ public class PostgreSqlBacktestRepository : IBacktestRepository
Score = entity.Score, Score = entity.Score,
ScoreMessage = entity.ScoreMessage ?? string.Empty, ScoreMessage = entity.ScoreMessage ?? string.Empty,
InitialBalance = entity.InitialBalance, InitialBalance = entity.InitialBalance,
NetPnl = entity.NetPnl NetPnl = entity.NetPnl,
PositionCount = entity.PositionCount
}); });
return (mappedBacktests, totalCount); return (mappedBacktests, totalCount);