From a2bae7424f681403e3f38dda46b1a4faeff384f0 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Sun, 3 Sep 2023 22:02:35 -0500 Subject: [PATCH] Add IsPublic to Agent. --- .../BotSharp.Core/Agents/Services/AgentService.GetAgents.cs | 2 +- src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj | 2 +- .../BotSharp.Core/Repository/DbTables/AgentRecord.cs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs index b9021a31..6b8d01bf 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs @@ -11,7 +11,7 @@ public partial class AgentService var query = from a in db.Agent join ua in db.UserAgent on a.Id equals ua.AgentId join u in db.User on ua.UserId equals u.Id - where ua.UserId == _user.Id || u.ExternalId == _user.Id + where ua.UserId == _user.Id || u.ExternalId == _user.Id || a.IsPublic select a.ToAgent(); return query.ToList(); } diff --git a/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj b/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj index ccbe92ab..763cbf5b 100644 --- a/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj +++ b/src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj @@ -4,7 +4,7 @@ netstandard2.1 10.0 false - 0.10.3 + 0.10.4 diff --git a/src/Infrastructure/BotSharp.Core/Repository/DbTables/AgentRecord.cs b/src/Infrastructure/BotSharp.Core/Repository/DbTables/AgentRecord.cs index 31754c8e..8d7d0951 100644 --- a/src/Infrastructure/BotSharp.Core/Repository/DbTables/AgentRecord.cs +++ b/src/Infrastructure/BotSharp.Core/Repository/DbTables/AgentRecord.cs @@ -14,6 +14,8 @@ public class AgentRecord : DbRecord, IBotSharpTable [MaxLength(512)] public string? Description { get; set; } + public bool IsPublic { get; set; } + [Required] public DateTime CreatedDateTime { get; set; }