Skip to content

Commit 5f7a8e5

Browse files
committed
Support multiple agent types filtering
1 parent ad0e351 commit 5f7a8e5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Infrastructure/BotSharp.Core/Repository/FileRepository/FileRepository.Agent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ public List<Agent> GetAgents(AgentFilter filter)
352352

353353
if (filter.Type != null)
354354
{
355-
query = query.Where(x => x.Type == filter.Type);
355+
var types = filter.Type.Split(",");
356+
query = query.Where(x => types.Contains(x.Type));
356357
}
357358

358359
if (filter.IsPublic.HasValue)

src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.Agent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ public List<Agent> GetAgents(AgentFilter filter)
284284

285285
if (filter.Type != null)
286286
{
287-
filters.Add(builder.Eq(x => x.Type, filter.Type));
287+
var types = filter.Type.Split(",");
288+
filters.Add(builder.In(x => x.Type, types));
288289
}
289290

290291
if (filter.IsPublic.HasValue)

0 commit comments

Comments
 (0)