Delete backtest by request id

This commit is contained in:
2025-07-18 19:34:16 +07:00
parent cb031522b4
commit fd117f9a2f
5 changed files with 39 additions and 1 deletions

View File

@@ -212,6 +212,18 @@ public class BacktestRepository : IBacktestRepository
}
}
public void DeleteBacktestsByRequestId(string requestId)
{
var backtests = _backtestRepository.AsQueryable()
.Where(b => b.RequestId == requestId)
.ToList();
foreach (var backtest in backtests)
{
_backtestRepository.DeleteById(backtest.Id.ToString());
}
}
public (IEnumerable<LightBacktest> Backtests, int TotalCount) GetBacktestsByUserPaginated(User user, int page,
int pageSize, string sortBy = "score", string sortOrder = "desc")
{