Fix filter by name for backtest
This commit is contained in:
@@ -526,6 +526,11 @@ public class PostgreSqlBacktestRepository : IBacktestRepository
|
||||
.Where(b => b.UserId == user.Id);
|
||||
if (filter != null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(filter.NameContains))
|
||||
{
|
||||
var nameLike = $"%{filter.NameContains.Trim()}%";
|
||||
baseQuery = baseQuery.Where(b => EF.Functions.ILike(b.Name, nameLike));
|
||||
}
|
||||
if (filter.ScoreMin.HasValue)
|
||||
baseQuery = baseQuery.Where(b => b.Score >= filter.ScoreMin.Value);
|
||||
if (filter.ScoreMax.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user